How to Install Odoo 13 on Ubuntu 18.04

In this tutorial, we will show you how to install Odoo 13 on an Ubuntu 18.04 VPS.

Odoo is a web-based open source business software which includes a number of business applications for Sales, Project and Warehouse management, CRM, Website/eCommerce, billing, accounting, inventory, and thousands of other additional modules developed by the large community. There are two Odoo editions currently available, the Community edition, which is free, and the Enterprise edition – in this tutorial, we will be installing the Community Edition of Odoo 13. It’s a straightforward install process, so let’s get started.

Prerequisites

The minimum system requirements for running Odoo with up to 5 users are 2 CPU Cores and 2GB of RAM. For the purposes of this tutorial, we will be using our SSD 2 VPS hosting plan.

The following is also required:

  • Ubuntu 18.04 VPS
  • PostgreSQL server
  • Python version 3.6 or later
  • SSH root access or a user with sudo privileges

Step 1: Connect to Your Server

Before we begin, you will need to connect to your server via SSH as the root user or as any other user that has sudo privileges.

To connect to your server as the root user, use the following command:

ssh root@IP_ADDRESS -p PORT_NUMBER

Make sure to replace IP_ADDRESS and PORT_NUMBER with your actual server IP address and SSH port number.

Once logged in, make sure that your server is up-to-date by running the following commands:

sudo apt-get update
sudo apt-get upgrade

Step 2: Install PostgreSQL Server

We will be using PostgreSQL as the database server for our Odoo application. To install PostgreSQL on your server, run the following command:

sudo apt install postgresql

After the installation is complete, make sure to enable the PostgreSQL server to start automatically upon server reboot with:

sudo systemctl enable postgresql

Step 3: Install ‘wkhtmltopdf’

The wkhtmltopdf package is an open-source tool that Odoo uses to make HTML pages into the PDF format so that it can print PDF reports. The recommended version for Odoo is 0.12.5, which is not available in the official Ubuntu 18.04 repositories.

In order to install the recommended version, run the following commands, which will download the .deb file and install it manually onto your system:

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

That’s it, wkhtmltopdf has been installed.

Step 4: Install Odoo 13

There are two different ways to install Odoo 13 on your Ubuntu 18.04 VPS.

The easiest and fastest way is from the official Odoo repository that can be installed through your official Ubuntu distribution repositories. This method allows you to install only one Odoo instance on your server.

Another way to install Odoo 13 on your server is within a Python virtual environment. This method allows you to install multiple Odoo instances on your server.

We will show you how to do the installation using both of these methods.

Method 1: Installing Odoo 13 from the Official Repository

Use this method only if you are planning to run one Odoo instance on your server.

First, you need to add the Odoo repository to your server. To do this, run the following commands as root:

wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
# echo "deb http://nightly.odoo.com/13.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list

Next, update the local package database:

sudo apt update

and install Odoo using the apt package manager:

sudo apt install odoo

This command will install Odoo 13, Python 3 and all necessary Python modules. It will also create a PostgreSQL user and start the Odoo instance. After the installation is completed, you can check the status of the Odoo service:

sudo systemctl status odoo

You can start your Odoo instance with:

sudo systemctl start odoo

You can stop your Odoo instance with:

sudo systemctl stop odoo

To enable your Odoo instance to start automatically upon a server reboot, you need to run the following command:

sudo systemctl enable odoo

Method 2: Installing Odoo 13 in a Python Virtual Environment

Use this method only if you are planning to run multiple Odoo instances on your server.

Let’s start by installing the following tools and dependencies needed for our Odoo installation:

sudo apt install git nodejs npm build-essential python3-pip python3-dev python3-venv python3-wheel python3-setuptools libpq-dev libldap2-dev libsasl2-dev libxslt1-dev node-less

Next, we need to create a new system user for our Odoo 13 instance and a new PostgreSQL user with the same name. Our user will be called odoo13 with a home directory in /opt/odoo13:

sudo useradd -m -d /opt/odoo13 -U -r -s /bin/bash odoo13
sudo su - postgres -c "createuser -s odoo13"

Now, we can start the Odoo installation using a python virtual environment. First, switch to the odoo13 user we have created in the previous step:

sudo su - odoo13

To clone the Odoo 13 source code from the Odoo GitHub repository, do the following:

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

Now, as the user odoo13, let’s create a new python virtual environment:

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

Then activate the virtual environment with:

source odoo13-venv/bin/activate

All Odoo dependencies are listed in the requirements.txt file, located at the root of the Odoo directory. Some installations also require the wheel package to be installed via pip. To install all of these from within the virtual environment, run the following commands:

(venv) $ pip3 install wheel
(venv) $ pip3 install -r odoo/requirements.txt

Once the installation is completed, you can exit the virtual environment and switch back to the sudo or root user with:

(venv) $ deactivate && exit

The following few commands are optional and can be used if you want to use custom modules for the Odoo instance. The best practice is to install custom Odoo modules in a separate directory. Therefore we will create a new directory for the custom modules and change its ownership to the ‘odoo13’ user.

mkdir /opt/odoo13/odoo13-custom-addons
chown odoo13: /opt/odoo13/odoo13-custom-addons

The following commands will create a log file for the new Odoo installation and change its ownership to the “odoo13” user:

mkdir /var/log/odoo13 && touch /var/log/odoo13/odoo.log
chown -R odoo13: /var/log/odoo13/

Next, we need to create a configuration file for our Odoo 13 instance. Create and open the file using your preferred text editor:

nano /etc/odoo13.conf

Then enter the following configuration:

[options]
admin_passwd = master_password
db_host = False
db_port = False
db_user = odoo13
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo13/odoo.log
addons_path = /opt/odoo13/odoo/addons,/opt/odoo13/odoo13-custom-addons

Please do not forget to change the master_password with a new strong password. You can generate a strong password through the command line. Save and close the file.

The last thing we need to do is to create a systemd unit file that we can use to run our Odoo instance as a service.

Create a new odoo13.service file:

nano /etc/systemd/system/odoo13.service

and enter the following configuration:

[Unit]
Description=Odoo13
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
SyslogIdentifier=odoo13
PermissionsStartOnly=true
User=odoo13
Group=odoo13
ExecStart=/opt/odoo13/odoo13-venv/bin/python3 /opt/odoo13/odoo/odoo-bin -c /etc/odoo13.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Run the following command to make systemd aware of the new unit file:

systemctl daemon-reload

Finally, we can use the following commands to start our new Odoo instance:

systemctl start odoo13

To enable your Odoo instance to start automatically upon a server reboot, you need to run the following command:

systemctl enable odoo13

To check and verify the status of our Odoo 13 service, run the following:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
systemctl status odoo13

If you want to install another Odoo instance, you can repeat all the steps from this section. Just remember to pick a different name for your second Odoo user, third Odoo user, and so on. You can name the user however you want, just do not forget to create a PostgreSQL user with the same name.

Step 5: Access the Odoo Instance

Now when you know that the fresh Odoo installation is active and running on the server, you can access it by navigating your server IP address along with the Odoo port number. In this case, our installed Odoo uses the default port 8069 (as defined in our odoo configuration file):

http://<your_server_IP_address>:8069

If the installation has been successfully completed, you will be able to see the Odoo screen as shown below and create your first database:

That’s it. You have now successfully installed Odoo 13 on your Ubuntu 18.04 VPS.


Of course, you don’t have to install Odoo 13 on Ubuntu 18.04 if you use one of our Odoo VPS Hosting services, in which case you can simply ask our expert Linux admins to install and configure Odoo 13 for you. They are available 24×7 and will take care of your request immediately. If you are using Ubuntu’s 20.04 version, but are having difficulties installing Odoo on it, you can use our great guide on How to Install Odoo 13 on Ubuntu 20.04.

PS. If you liked this post on how to install Odoo 13 on Ubuntu 18.04, please share it with your friends on the social networks using the buttons below or simply leave a reply. Thanks.

5 thoughts on “How to Install Odoo 13 on Ubuntu 18.04”

Leave a Comment