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

How to Install Google Cloud BigQuery Python client library on Linux

In this article, we will see how to Install Google Cloud BigQuery Python client library…

2 days ago

Wallpaper Contest for Xfce 4.20 open for voting

Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…

2 days ago

Canonical announces the first MicroCloud LTS release

MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…

3 days ago

Join Canonical in Paris at Dell Technologies Forum

Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…

4 days ago

Bringing automation to open source 5G software at Ubuntu Summit 2024

In today’s massive private mobile network (PMN) market, one of the most common approaches to…

5 days ago

Ubuntu Weekly Newsletter Issue 865

Welcome to the Ubuntu Weekly Newsletter, Issue 865 for the week of November 3 –…

7 days ago