How to install Odoo 11 on Ubuntu 18.04

Odoo is the most popular all-in-one business software in the world packed up a range of business applications, including CRM, website ,e-Commerce, billing, accounting, manufacturing, warehouse, project management, inventory and much more, all seamlessly integrated.

There are several ways to install Odoo depending on the required use case. This guide covers the steps necessary for installing and configuring Odoo for production using Git source and Python virtual environment on a Ubuntu 18.04 system.

Update the system to the latest packages:

sudo apt update && sudo apt upgrade

Copy

Install gitpip and all other tools and libraries required 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

Copy

Create a new system user and group with home directory /opt/odoo that will run the Odoo service.

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

Copy

You can name the user whatever you like, just make sure you create a postgres user with the same name.

Install the Postgres package from the Ubuntu’s default repositories:

sudo apt-get install postgresql

Copy

Once the installation is completed create a postgres user with the same name as the previously created system user, in our case odoo:

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

Copy

We will install odoo from the GitHub repository inside an isolated Python environment so we can have more control over versions and updates.

Before starting with the installation process, make sure you switch to odoo user.

sudo su - odoo

Copy

To confirm that you are logged-in as odoo user you can use the following command:

whoami

Copy

Now we can start with the installation process, first clone the odoo from the GitHub repository:

git clone https://www.github.com/odoo/odoo --depth 1 --branch 11.0 /opt/odoo/odoo11

Copy

  • If you want to install a different Odoo version just change the version number after the --branchswitch.
  • You can name the directory as you like, for example instead odoo11 you can use the name of your domain.

To create a new virtual environment for our Odoo 11 installation run:

cd /opt/odoo
python3 -m venv odoo11-venv

Copy

activate the environment with the following command:

source odoo11-venv/bin/activate

Copy

and install all required Python modules with pip3:

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

Copy

pip3 is a tool for installing and managing Python packages.

If you encounter any compilation errors during the installation, make sure that you installed all of the required dependencies listed in the Before you begin section.

Once the installation is completed deactivate the environment and switch back to your sudo user using the following commands:

deactivate
exit

Copy

If you plan to install custom modules it is best to install those modules in a separate directory. To create a new directory for our custom modules run:

sudo mkdir /opt/odoo/odoo11-custom-addons
sudo chown odoo: /opt/odoo/odoo11-custom-addons

Copy

Next, we need to create a configuration file, we can either create a new one from scratch or copy the included configuration file:

sudo cp /opt/odoo/odoo11/debian/odoo.conf /etc/odoo11.conf

Copy

Open the file and edit it as follows:

/etc/odoo11.conf
[options]
; This is the password that allows database operations:
admin_passwd = my_admin_passwd
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo11/addons
; If you are using custom modules
; addons_path = /opt/odoo/odoo11/addons,/opt/odoo/odoo11-custom-addons

Copy

Do not forget to change the my_admin_passwd to something more secure and adjust the addons_pathif you’re using custom modules.

How to install Odoo 11 on Ubuntu 18.04