In this tutorial, we want to teach you to Install and Configure Odoo 16 on Ubuntu 22.04.
Odoo is an integrated software solution that can handle most business processes all in one system. Odoo’s modular structure is fully mature and includes more than 2,500 modules.
Because of the optimized interfaces, all Odoo modules communicate easily with each other, which means you get the best overview of your business and the fastest data processing to manage your daily tasks.
The flexibility that Odoo offers is unmatched on the market. No matter how complex and multi-layered a company is, Odoo can adapt to each company’s unique needs and budget.
In particular, Odoo has perfected digitization, integration, and automation.
Steps To Install and Configure Odoo 16 on Ubuntu 22.04
Odoo has a few installation options such as from the APT repository, using docker, or installing in a virtual environment.
In this article, you will learn to install Odoo in a Python virtual environment.
Before you start to do this, you need some requirements first.
You must log in to your server as a non-root user with sudo privileges and set up a basic firewall. To do these, you can follow our article about the Initial Server Setup with Ubuntu 22.04.
Dependencies For Odoo on Ubuntu 22.04
First, you need to update and upgrade your local package index with the following command:
sudo apt update && sudo apt upgrade -y
Now you can run the following command to install Odoo dependencies on Ubuntu 22.04:
sudo apt install -y build-essential wget git python3-pip python3-dev python3-venv python3-wheel libfreetype6-dev libxml2-dev libzip-dev libsasl2-dev python3-setuptools libjpeg-dev zlib1g-dev libpq-dev libxslt1-dev libldap2-dev libtiff5-dev libopenjp2-7-dev
Install PostgreSQL on Ubuntu 22.04
Odoo only supports PostgreSQL to store its data. At this point, you need to install PostgreSQL by using the command below:
sudo apt install postgresql -y
When your installation s completed, you need to create a new PostgreSQL user for your Odoo 16. To do this, run the command below:
sudo su - postgres -c "createuser -s odoo16"
Install the wkhtmltopdf Tool on Ubuntu 22.04
wkhtmltopdf is an open-source command-line tool that supports the rendering of HTML pages into PDF and other similar formats. You can easily install it by using the command below:
sudo apt install wkhtmltopdf -y
Verify your installation by checking its version:
Output wkhtmltopdf 0.12.6
Set up Odoo 16 on Ubuntu 22.04
Here you should create a new system user and group with a home directory under the /opt/odoo16 that will need to be able to run an Odoo service. To do this, run the following command:
sudo useradd -m -d /opt/odoo16 -U -r -s /bin/bash odoo16
You need to change the user to odoo16 with the following command:
sudo su - odoo16
Then, clone the Odoo16 official source code from GitHub with the following command:
git clone https://www.github.com/odoo/odoo --depth 1 --branch 16.0 odoo16
Next, you need to create a new Python virtual environment for Odoo with the following command:
python3 -m venv odoo-venv
Activate it with the command below:
Now from the virtual environment, install all required Python modules with pip3 with the following command:
(odoo-venv) $ pip3 install wheel
(odoo-venv) $ pip3 install -r odoo16/requirements.txt
This will take some time to complete.
When you are done, deactivate the environment with the following command:
(odoo-venv) $ deactivate
Here you need to create a new directory in the /opt/odoo16 path. It will contain third-party add-ons that you are going to include in the configuration.
You will add this directory to the configuration file that you will create below. This will define a list of directories where Odoo will search for modules.
Now exit from the odoo16 user:
Create the configuration file with your favorite text editor, here we use the vi editor:
sudo vi /etc/odoo16.conf
Paste the following contents to the file:
[options] admin_passwd = StrongPassword db_host = False db_port = False db_user = odoo16 db_password = False addons_path = /opt/odoo16/odoo16/addons,/opt/odoo16/odoo16/custom-addons xmlrpc_port = 8069
Remember to choose a strong password.
When you are done, save and close the file.
Now you can start to access the Odoo dashboard.
Manage Odoo 16 Service on Ubuntu 22.04
At this point, you need to create a service unit file called odoo16.service in the /etc/systemd/system/ directory with the following command:
sudo vi /etc/systemd/system/odoo16.service
Paste the following configuration in the file:
[Unit] Description=Odoo16 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo16 PermissionsStartOnly=true User=odoo16 Group=odoo16 ExecStart=/opt/odoo16/odoo-venv/bin/python3 /opt/odoo16/odoo16/odoo-bin -c /etc/odoo16.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
When you are finished, save and close the file.
To apply the changes, reload systemd with the following command:
sudo systemctl daemon-reload
Now start and enable the Odoo 16 on Ubuntu 22.04 with the following command:
sudo systemctl enable --now odoo16
Verify that your service is active and running with the following command:
sudo systemctl status odoo16
In your output you will see:
Output ● odoo16.service - Odoo16 Loaded: loaded (/etc/systemd/system/odoo16.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2023-02-28 12:57:38 UTC; 4s ago Main PID: 27841 (python3) Tasks: 4 (limit: 4575) Memory: 74.1M CPU: 2.296s CGroup: /system.slice/odoo16.service └─27841 /opt/odoo16/odoo-venv/bin/python3 /opt/odoo16/odoo16/odoo-bin -c /etc/odoo16.conf ...
Access Odoo 16 Web Interface
Now that you have your service up and running, open your web browser and type your IP address followed by 8069 to access the Odoo 16 dashboard:
You should see the Odoo login interface as shown below:
In the “Master password” put the password that you have defined in the configuration file.
And enter other credentials to create the database. Then, you will see the following screen. Enter the Email address and password you have defined in the login screen.
You should see your Oddo 16 dashboard on Ubuntu 22.04:
Odoo is easy to master due to its intuitive interface and straightforward user environment. It is feasible to train teams of different ages and levels.
You can add required applications and functionalities over time when your company increases or new departments open. Odoo is quite modular software to fit your specific strategies and initiatives.
It accompanies other systems like existing ERP or CRM to save time by training, implementing, and allowing growth and evolution inside the software.
At this point, you have learned to Install and Configure Odoo 16 on Ubuntu 22.04.
Hope you enjoy it. You may be like these articles:
Set up Ruby on Rails with rbenv on Ubuntu 22.04
Install and Configure OpenNMS on Ubuntu 22.04