Categories: TutorialsUbuntu

How to Install and Setup Odoo on Ubuntu Linux

This brief guide shows how to install Odoo on Ubuntu Linux. If you are a beginner or a new user and want to install the Odoo on your ubuntu Linux system then this short tutorial is useful and handy for you.

Odoo is simple, popular and open-source suite of business management application. It provides many business management application such as CRM, e-Commerce solutions, website builder, Billing & Accounting, invoices, manufacturing, orders, products, inventory, Point of Sale, Warehouse Management, and much more.

For more details about Odoo, please visit its official homepage.


Install and Setup Odoo on Ubuntu Linux

Sponsored

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

There are many ways to install it on Ubuntu Linux. The quickest way to install it by using the official Odoo APT repositories. In this tutorial, we are going to install it by custom way.

Step 1 : Install Required Dependencies

First of all, you will need to install required and supporting dependencies to install Odoo in you system. To do that, run the commands below:

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

Step 2 : Create a Odoo system User

Next, you will need to create a system user account for Odoo called odoo with home directory /opt/odoo :

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

Step 3 : Install and Configure PostgreSQL

Odoo uses PostgreSQL database server as backend to store content. To install PostgreSQL, run the command below:

sudo apt install postgresql

To enable and start PostgreSQL services, run the command below:

sudo systemctl enable --now postgresql.service

Now, create a PostgreSQL database user called odoodbuser . To do that, run the commands below:

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

Step 4 : Install Wkhtmltopdf

The Wkhtmltopdf provides a set of open-source command-line tools that can render HTML into PDF and other various image formats. To download and install Wkhtmltopdf package, run the wget command as shown below:

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

Step 5 : Install and Configure Odoo

Before installing Odoo, switch to the Odoo system user account that we created in above steps:

sudo su - odoo

Next, run the command below to clone Odoo version 15 :

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

At the writing of this tutorial, the latest version of Odoo is 15. If there are a new version available then you should clone that version.

After download, change your directory into Odoo’s directory:

cd /opt/odoo

After that, install and configure all required modules for running Odoo by running the command below;

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

Next, create a new directory for custom 3rd party addons:

mkdir /opt/odoo/odoo-custom-addons

To exit and back to your sudo user, run the command below:

exit

Next, Create and open Odoo’s configuration file:

sudo nano /etc/odoo.conf

After that, copy the below content and paste into the file:

[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 and exit.


Step 6 : Create a Systemd Unit File

Now, you will need to create a systemd unit file to control Odoo services. To do that, run the command below;

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

Copy the below content and paste into the file:

[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

Save your changes and exit.

Next, reload systemd daemon to notify that a new file is created:

sudo systemctl daemon-reload

Start up the Odoo service and enable it to start on boot:

sudo systemctl enable --now odoo

Run the command below to verify the installation and check service status:

sudo systemctl status odoo

The above command will print a output similar like below:

● odoo.service - Odoo
     Loaded: loaded (/etc/systemd/system/odoo.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2021-10-28 14:48:16 CDT; 17s ago
   Main PID: 1858 (python3)
      Tasks: 2 (limit: 2761)
     Memory: 56.2M
     CGroup: /system.slice/odoo.service
             └─1858 /opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Step 7 : Login to Odoo

To login, open your favorite browser and browse to http://hostname_or_IP_address>:8069 :

http://localhost:8069

If the installation is successful then you get a result similar like below:

Fill the database account details and admin password that you defined in the configuration file above and complete the setup.

If you face issues and Internal server error or get error when launch Odoo setup wizard then you need to configure PostgreSQL to trust all local connections.

To do that, open PostgreSQL configuration file by running command below:

sudo nano /etc/postgresql/12/main/pg_hba.conf

Replace the version number with yours.

After open the configuration file, replace MD5 or Peer with trust as shown the below:

# "local" is for Unix domain socket connections only
local   all             all                    trust

Save the changes and exit.

Now, restart PostgreSQL services by running the command below:

sudo service postgresql restart

That’s all

If you find any error and issue in above steps , please use comment box below to report.

If our article helps you, please consider buying us a coffee

Thank you for your support.

The post How to Install and Setup Odoo on Ubuntu Linux appeared first on Linux Tutorial Hub.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

12 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

1 day ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago