Install Odoo 12 CE on Ubuntu 19.04

  • NOTE: These instructions apply to Odoo 12 Community Edition and Ubuntu 19.04, for Ubuntu 18.04 use this link.

As of 7/6/2019, the install process for odoo12 on Ubuntu 19.04 requires some workarounds, please make sure to follow instructions. Also, make sure you use SSL (HTTPS) when placing into production.

  • This tutorial assumes you have a working install of Ubuntu 19.04 and root access.

Prepare Requirements:

  • Update Ubuntu: (login as root)
su root
sudo apt update && sudo apt-get dist-upgrade -y
  • Install Main 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 python3-img2pdf node-less
Requred for Python 3.7 (Pillow, psycopg2)
sudo apt-get install libpcap-dev libpq-dev
sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev tcl8.6-dev tk8.6-dev python-tk

Install Wkhtmltopdf

In order to print PDF reports, you will need the wkhtmltopdf tool. Ubuntu 19.04 installs version 0.12.5 by default but the version I was able to get to work for Odoo is
  • NOTE: Odoo documentation recommends wkhtmltopdf 0.12.5 but I kept getting no header or logos on my PDFs. If you know a way of getting 0.12.5 to work on this setup, please let me know. You can find supported Wkthmltopdf for Odoo here.
First install missing dependencies in Ubuntu 19.04. On ubuntu 19.04, libssl1.0.0 is no longer in the repositories.
sudo dpkg -i ./libssl*.deb
  • Download wkhtmlox package using wget and install:
sudo wget
sudo dpkg -i ./wkhtmltox_0.12.1.3-1~bionic_amd64.deb

Create user “odoo12”

We will create a user with a Home Directory where we will later place the Odoo12 installation from GitHub:
sudo useradd -m -d /opt/odoo12 -U -r -s /bin/bash odoo12

Install and Setup Odoo PostgreSQL Database

  • Install PostgreSQL:
sudo apt-get install postgresql

Create user odoo12 for PostgreSQL

We are going to create a user similar to the one we previously created to run Odoo:
sudo su - postgres -c "createuser -s odoo12"

Install and Configure Odoo 12

Now let’s switch to odoo12 user:
sudo su - odoo12
Clone the GitHub Repository:
git clone --depth 1 --branch 12.0 /opt/odoo12/odoo

Install Python requirements for Odoo 12

We should be in the following directory: (/opt/odoo12)
  • Move to Odoo folder and then create a new virtual environment with the command:
cd /opt/odoo12
python3 -m venv odoo-venv
Activate the environment with the command:
source odoo-venv/bin/activate
Upgrade pip3 and install requirements:
pip3 install --upgrade setuptools
pip3 install fpdf img2pdf wheel gdata
pip3 install -r odoo/requirements.txt
Optional: Here are additional requirements that may have been missed. There might be overlap but not a problem.
pip3 install Babel decorator docutils ebaysdk feedparser gevent greenlet html2text Jinja2 lxml Mako MarkupSafe mock num2words ofxparse passlib Pillow psutil psycopg2 pydot pyparsing PyPDF2 pyserial python-dateutil python-openid pytz pyusb PyYAML qrcode reportlab requests six suds-jurko vatnumber vobject Werkzeug XlsxWriter xlwt xlrd gdata
Deactivate the environment, and exit back to the standard user with the commands:

Setup Odoo Config

Create custom addons Directory:
su odoo12
mkdir /opt/odoo12/odoo-custom-addons
Go back to sudo user:
Create Odoo Config file:
sudo nano /etc/odoo12.conf
Paste the following content into your new config file:
; This is the password that allows database operations:
admin_passwd = my_admin_passwd
db_host = False
db_port = False
db_user = odoo12
db_password = False
addons_path = /opt/odoo12/odoo/addons,/opt/odoo12/odoo-custom-addons
Change “my_admin_passwd” to a secure password.

Create Odoo12 Service

To run Odoo as a service we need to create a service unit file in the \etc\systemd\system\ directory.
sudo nano /etc/systemd/system/odoo12.service
Requires=postgresql.service postgresql.service

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


Load the Odoo12 service

sudo systemctl daemon-reload
sudo systemctl start odoo12
sudo systemctl enable odoo12
Check status of Odoo 12 Service
sudo systemctl status odoo12
  • Goto the website and fill out the new database creation form:
  • Use the IP of your server on port 8069: http://YOUR_IP:8069
  • Type in admin password in config file and give your new database a name.
  • Setup email and password for admin