Knowledgebase

Question About Servers

How to Install Odoo 13 on Ubuntu 18.04 Print

  • 0

In this article, we will cover each step of the Odoo 13 installation on Ubuntu 18.x.

Prerequisites

Operating system: Ubuntu 18.x (most commonly 18.04)

Server resources: 2-core CPU & 2GB of RAM

Access: ability to connect to a server via SSH

Permissions: a user with root privileges (able to use the 'sudo' command)

Note: you can execute all of the commands below from the 'root' user, but for security purposes, it is recommended that you use a separate user with sudo privileges.

 

Step 1: Connect to Your Server With SSH.

The first step is to connect to the server via the SSH protocol. That way, you will be able to execute any commands in your server's terminal.

Step 2: Add New Repositories

The first thing to do is to add specific package repositories. We will need them later on for the packages that are not available in the official repositories.

sudo add-apt-repository universe
sudo add-apt-repository ppa:deadsnakes/ppa

Note: after sending this command, you will need to press Enter to confirm the installation.

Step 3: Update the Packages

The next step is to update all of the existing packages on the server:

sudo apt-get update
sudo apt-get upgrade -y

Step 4: Create a Dedicated Odoo User

Odoo ERP is designed to run as a system service. We want to only allow it to do the things it needs to do - nothing more.

Thus, we will create a dedicated user for Odoo 13 without root permissions. The home directory will be /opt/odoo, which is where Odoo 13 will reside.

sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo

Step 5: Install and Configure PostgreSQL Database

Odoo 13 stores user data in a database engine called PostgreSQL. Use this command to install it:

sudo apt-get install postgresql -y

Once done, create a user an Odoo user in PostgreSQL:

sudo su - postgres -c "createuser -s odoo"

Step 6 : Install Wkhtmltopdf

One of the extra packages Odoo requires is Wkhtmltopdf, which allows for HTML to PDF conversion.

Download the package:

sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb

Install the required dependencies:

sudo apt-get install libjpeg-turbo8 libjpeg-turbo8 libxrender1 xfonts-75dpi xfonts-base -y
sudo apt-get install fontconfig

Note: if you encounter an installation error during this step, the next command will help.

sudo apt-get install -f

Finally, install the downloaded Wkhtmltopdf package with the following command:

sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

The last step is to tell the operating system where to look for the Wkhtmltopdf package:

sudo ln -s /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -s /usr/local/bin/wkhtmltoimage /usr/bin

Step 7: Install the Required Dependencies

There is a number of packages that need to be installed in order for Odoo 13 to work.

Use the following commands to install them:

sudo apt-get install python3 python3-pip python3-suds wget git bzr gdebi-core libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev libssl-dev -y

Install node packages:

sudo apt-get install node-clean-css node-less git -y

Step 8. Install Python 3.6

Odoo 13 does not work with the default version of Python, so we need to specifically install version 3.6:

sudo apt install python3.6 python3.6-dev python3.6-venv

Step 9: Install and Configure Odoo 13

Now we can download and set-up Odoo itself.

First of all, let's do this step as the odoo user:

sudo su - odoo

Download Odoo 13 source code from the official repository into the /opt/odoo/odoo13 directory:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 13.0 /opt/odoo/odoo13

Step 10: Install Python Modules

The source code is now downloaded, but it needs a number of Python modules and libraries to be functional

The first thing to do is to create a virtual environment to separate Odoo's Python modules from the system's Python modules:

cd /opt/odoo && python3 -m venv odoo13-venv

Start the environment:

source odoo13-venv/bin/activate

Now that we're isolated, it's time to install all of the modules and libraries required for Odoo 13 to work. The requirements.txt contains all the needed pieces, so that we can download and install them all at once:

pip3 install -r odoo13/requirements.txt

In case you'll see orange warnings, you can ignore them.

Let's stop the virtual environment and return to the initial Ubuntu user:

deactivate && exit

Step 11: Create Directories for Log Files and Custom Addons

Let's prepare for potential custom addons by creating a separate directory:

sudo mkdir /opt/odoo/odoo13-custom-addons

Make sure the odoo user is the owner of that directory.

sudo chown odoo: /opt/odoo/odoo13-custom-addons

Let's do the same for log files. Create a separate directory and an empty file inside of it:

sudo mkdir /var/log/odoo13 && sudo touch /var/log/odoo13/odoo.log

Change the owner to the odoo user:

sudo chown -R odoo: /var/log/odoo13/

Step 12 : Create the Odoo Configuration File

The Odoo configuration files specifies important settings such as the database username or admin password.

Create and open the configuration file with the following command (we use nano as our text editor):

sudo nano /etc/odoo.conf

Copy the following settings and paste them into the config file. Make sure to change the admin_passwd value - it should be a secure value as it grants admin Odoo rights to the user.

[options]

; This is the password that allows database operations:

admin_passwd = master_password

db_host = False

db_port = False

db_user = odoo

db_password = False

xmlrpc_port = 8069

; longpolling_port = 8072

logfile = /var/log/odoo13/odoo.log

logrotate = True

addons_path = /opt/odoo/odoo13/addons,/opt/odoo/odoo13-custom-addons

Note: If you are a SolaDrive customer and use one of our Odoo VPS Hosting services you can simply ask our expert Odoo specialists to change your Odoo password for you. We are available 24x7 via chat or ticket and will take care of your request immediately.

When you're done, save the file and close it.

The final step is to change the owner of the file, as well as the access permissions:

sudo chown odoo:odoo /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf

Step 13: Create the systemd Configuration File

In order to run Odoo by default as a system service, we need to create a dedicated systemd configuration file.

Create and open the new config file:

sudo nano /etc/systemd/system/odoo13.service

Copy and paste the following settings into it:

[Unit]

Description=Odoo13

#Requires=postgresql-10.6.service

#After=network.target postgresql-10.6.service



[Service]

Type=simple

SyslogIdentifier=odoo13

PermissionsStartOnly=true

User=odoo

Group=odoo

ExecStart=/opt/odoo/odoo13-venv/bin/python3.6 /opt/odoo/odoo13/odoo-bin -c /etc/odoo.conf

StandardOutput=journal+console



[Install]

WantedBy=multi-user.target

When you're done, save the file and close it.

Step 14: Make Odoo Run on the Background

The following command will start Odoo 13 on the background:

sudo systemctl start odoo13.service

Last but not least, let's make sure the Odoo service always starts automatically:

sudo systemctl enable odoo13.service

 

Success! You have completed Odoo 13 installation on Ubuntu 18.x.

Step 15: Start Using Odoo 13 From Your Browser

Odoo 13 interface should now be available in your web browser. Just go to the following URL:

http://server_IP:8069
  • server_IP is the network address of your remote server.

You should now be seeing the configuration form:









Was this answer helpful?

« Back

Enterprise-Grade Hardware

  • Samsung
  • Juniper
  • Western Digital
  • Supermicro
  • LSI
  • Intel
  • R1Soft Backups
  • cPanel
  • MySQL
  • Parallels
  • HP Partner