How to Install Odoo on Ubuntu 18.04

Install Odoo on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Odoo on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Odoo is the most extensive open-source ERP that provides all business-related applications. Such as Accounting, CRM, Sales, Purchase, Project, Point of Sale, E-Commerce, and many more.

Install Odoo on Ubuntu

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade

Step 2. Install Odoo dependencies.

 You have to install Git, Python 3 pip, and other required packages to build Odoo dependencies:

sudo apt install git python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less

Step 3. Creating a System User.

Create a system user that will run Odoo, named ramona with home directory /opt/ramona:

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

Step 4. Install PostgreSQL.

To install PostgreSQL run the following command:

sudo apt install postgresql

Next, create a PostgreSQL user with the same name as the previously created system user:

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

Step 5. Install wkhtmltopdf.

Download and install the Wkhtmltopdf package. The recommended version is 0.12.5 and is available on the wkhtmltopdf download page, in the archive section:

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

Step 6. Install Odoo on Ubuntu.

First, change to user “ramona”:

sudo su - ramona

Next, clone the Odoo 13 source code from the GitHub repository:

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

Once the download is complete, create a new Python virtual environment for Odoo:

cd /opt/odoo13
python3 -m venv odoo-venv
source odoo-venv/bin/activate

Install all required Python modules with pip3:

pip3 install wheel
pip3 install -r odoo/requirements.txt

Once done, deactivate the environment by typing:

deactivate

Then, We’ll create a new directory that will hold the 3rd party addons:

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

Next, create a configuration file with the following content:

sudo nano /etc/odoo13.conf
[options]
; This is the password that allows database operations:
admin_passwd = your_admin_passwd
db_host = False
db_port = False
db_user = ramona
db_password = False
addons_path = /opt/odoo13/odoo/addons,/opt/odoo13/odoo-custom-addons

Step 7. Creating Systemd Unit File Odoo.

Open nano text editor and create a service unit file called odoo 13.service with the following content:

sudo nano /etc/systemd/system/odoo13.service
[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/odoo-venv/bin/python3 /opt/odoo13/odoo/odoo-bin -c /etc/odoo13.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

Start the Odoo service and enabled it to start on boot by running:

sudo systemctl daemon-reload
sudo systemctl enable --now odoo13
sudo systemctl status odoo13

Step 8. Accessing Odoo.

To access Odoo 13, go to the following URL and create a new database:

http://<your_domain_or_IP_address>:8069

That’s all you need to do to install Odoo on Ubuntu 18.04 LTS. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.