This post shows students and new users how to install Odoo on Ubuntu Linux. Odoo (formerly OpenERP) is a simple and intuitive set of open source, ERP, and CRM platform for businesses and individuals who want to manage their e-commerce, website builder, billing, accounting, invoices, orders, products, and more.

If you are looking for open source CRM or ERP software to run your operations, you should consider Odoo.

Odoo can be installed in many different ways on Ubuntu Linux. The easiest and fastest way to install Odoo is by using the official Odoo APT repositories. However, you lose control when you have Odoo install and configure settings that you may not know where and how they are configured.

Next, you will be shown how to download, install and use Odoo on Ubuntu Linux.

When you are ready to install Odoo on Ubuntu Linux, follow the steps below.

How to install Odoo package dependencies on Ubuntu Linux

To do a custom installation of Odoo, you will need to install packages like Git, Node.js, Pip, and others. Run the following commands to install the support dependencies to install Odoo.

sudo apt update
sudo apt install git python3-pip build-essential wget python3-dev python3-venv
 python3-wheel libfreetype6-dev libxml2-dev libzip-dev libldap2-dev libsasl2-dev
 python3-setuptools node-less libjpeg-dev zlib1g-dev libpq-dev  libxslt1-dev libldap2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev

How to create an Odoo system user in Ubuntu Liux

After installing the required packages above, you will also want to create a system account for Odoo. Running Odoo with root privileges presents great security risks.

YOU CAN ALSO READ:   How to install Nginx on Ubuntu Linux

To create a system account to use with Odoo, simply run the command below to create a system account called odoo .

The account home directory will be / opt / odoo

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

How to install PostgreSQL on Ubuntu Linux

Odoo uses the PostgreSQL database to store its content. To install PostgreSQL, just run the following commands.

sudo apt install postgresql

After installing the database server, enable and start it by running the following commands.

sudo systemctl enable --now postgresql.service

Next, create a PostgreSQL database account for Odoo. Run the following commands to create a new database account called odoodbuser.

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

Then create a new database account called odoodb

sudo su - postgres -c "createdb odoodb"

Then grant all privileges to odoodbuser user in the odoodb database.

sudo -u postgres psql
grant all privileges on database odoodb to odoodbuser;

How to install Wkhtmltopdf on Ubuntu Linux

To print PDF reports, you will need Wkhtmltopdf. This package contains open source toolkits for converting HTML to PDF and various image formats on Linux systems, including Ubuntu Linux.

To install the package, run the following commands.

cd /tmp
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

How to install and configure Odoo on Ubuntu Linux

Now that you have installed all the dependencies, installed and created the PostgreSQL database and account, continue below to download, install and configure Odoo on Ubuntu Linux.

The first thing you’ll want to do is switch to the Odoo system account we created earlier by running the following commands:

sudo su - odoo

At the time of this publication, the latest version of Odoo is the version fifteen. If there is a newer version of Odoo available, you should clone it instead. To clone Odoo version 15, run the following commands.

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

When the download is complete, change to the Odoo directory and run the following commands to configure and install all the Odoo requirements.

cd /opt/odoo
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip3 install wheel
pip install python-ldap
pip3 install -r odoo/requirements.txt
deactivate

After that create a new directory for custom Odoo plugins.

mkdir /opt/odoo/odoo-custom-addons

Departure:

exit

When you’re done, add the Odoo administrator password, database name, and database account name to your configuration file.

YOU CAN ALSO READ:   How to install Drupal on Ubuntu Linux with Apache

Run the following commands to open the Odoo configuration file.

sudo nano /etc/odoo.conf

Then copy paste the lines below into the file, save it and exit.

[options]
; This is the password that allows database operations:
admin_passwd = type_new_password_here
db_host = False
db_port = False
db_user = odoodbuser
db_password = False
addons_path = /opt/odoo/odoo/addons,/opt/odoo/odoo-custom-addons

Save your changes and exit

How to create a Systemd drive file in Ubuntu Linux

At this point, everything should be ready. What you need to do now is create a systemd unit file to control the startup, restart and shutdown of the Odoo services.

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

Then copy paste the lines below in the file, save and exit

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

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

[Install]
WantedBy=multi-user.target

When you’re done, reload the systemd daemon and start the Odoo service.

sudo systemctl daemon-reload
sudo systemctl enable --now odoo

To check the status of Odoo and verify that it is installed and working, run the following commands:

sudo systemctl status odoo

You should see messages similar to the following:

● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-10-26 23:28:23 CDT; 11s ago
   Main PID: 18386 (python3)
      Tasks: 2 (limit: 4651)
     Memory: 67.2M
     CGroup: /system.slice/odoo.service
             └─18386 /opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Oct 26 23:28:25 ubuntu2004 odoo[18386]:     return Cursor(self.__pool, self.dbname, self.dsn, serialized=seriali>
Oct 26 23:28:25 ubuntu2004 odoo[18386]:   File "/opt/odoo/odoo/odoo/sql_db.py", line 256, in __init__
Oct 26 23:28:25 ubuntu2004 odoo[18386]:     self._cnx = pool.borrow(dsn)
Oct 26 23:28:25 ubuntu2004 odoo[18386]:   File "/opt/odoo/odoo/odoo/sql_db.py", line 588, in _locked
Oct 26 23:28:25 ubuntu2004 odoo[18386]:     return fun(self, *args, **kwargs)
Oct 26 23:28:25 ubuntu2004 odoo[18386]:   File "/opt/odoo/odoo/odoo/sql_db.py", line 654, in borrow
Oct 26 23:28:25 ubuntu2004 odoo[18386]:     result = psycopg2.connect(

That should do it if you follow and complete all the steps above.

YOU CAN ALSO READ:   How to install Jenkins on Ubuntu Linux

How to login to Odoo on Ubuntu Linux

Once you see a successful status above, you can open your browser and navigate to the Odoo portal using the hostname of the server or the IP address followed by the port 8069.

http://localhost:8069

Next, you should see the Odoo settings page. Use the master password you created in /etc/odoo.conf proceedings. then write a new database name odoodb and administrator email address. then click Create database

Odoo ubuntu installation
Ubuntu installation of Odoo 13

After a few, you should see the Odoo applications page to select your preferred applications to install.

Odoo Ubuntu 13
After that, you should be good to go!

Conclusion:

In this tutorial we have seen how to install and configure Odoo on Ubuntu Linux. If you find any bugs or have something to add, please use the comment form below.

Write A Comment