Odoo is a simple and most popular open-source intuitive suite of business applications that support companies or individuals to run and manage their business. Using this platform, individuals can manage invoices, customers, inventories, products, and more. It includes a wide range of accounting and human resource components to help manage finances and employees.
You can install this platform in different ways, according to business use cases and available technologies. The most simple and easiest way to install this platform from Odoo official Apt repository. In this article, we will briefly explain how to install and configure the Odoo 14 server on Ubuntu 20.04 system.
Before starting the installation, you need to install some prerequisites on your system that are necessary to run this software. So, follow the following steps to install all prerequisites:
Step 1: Install Dependencies or Prerequisites of Odoo 14
For the custom installation of Odoo 14, you need to install required packages such as Node.js, Git, Pip, and other tools on your system. The following command is used to install the required packages:
$ 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
Step 2: Create Odoo user
You can’t run Odoo under the root user due to some security risk. Therefore, you will create a new user for running the Odoo services. Users will group under the home directory such as /opt/odoo14. Using the following command you can perform this task:
$ sudo useradd -m -d /opt/odoo14 -U -r -s /bin/bash odoo14
You can assign any name to the above user as per your requirements.
Step 3: Install PostgreSQL
Odoo platform stores contents using the PostgreSQL database. So, you will install it with all dependencies by using the following command:
$ sudo apt install postgresql
After completing the installation of PostgreSQL, create a user with the exact same name as you have created the above Odoo system user. In the above step, we have created an Odoo user with the name odoo14. Therefore, the name of the PostgreSQL user will remain the same.
$ sudo su - postgres -c "createuser -s odoo14"
Step 4: Install wkhtmltopdf
The wkhtmltopdf is an open-source and set of command-line tools that are used for generating PDF reports and image formats from the HTML design. So, using these tools, you can print PDF reports in Odoo platform, you will install the wkhtmltox package. The wkhtmltopdf version 0.12.5 is recommended for Odoo14, which you can easily download from Github:
$ sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
Once the download is completed, install this package by using the following command:
$ sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb
As you have seen, all prerequisites have been installed on your system. Now, you can start the installation of Odoo14 using the following method:
Step 5: Install and Configure Odoo 14
We will install Odoo 14 inside the python virtual environment. So, switch a user as odoo14 which we have created in the above user creation step. Run the following command to change user:
$ sudo su - odoo14
Now, in the next step clone the Odoo 14 package by using the following command:
$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo14/odoo
For Odoo installation, you need to create a new python virtual environment using the below-given commands:
$ cd /opt/odoo14
$ python3 -m venv odoo-venv
The virtual environment will be activated by using the following command:
$ source odoo-venv/bin/activate
Now, using pip3 install all the necessary packages.
$ pip3 install wheel
$ pip3 install -r odoo/requirements.txt
Once you have installed the above packages, deactivate the virtual environment using the below-given command:
$ deactivate
To keep the third party addons, create a new directory.
$ mkdir /opt/odoo14/odoo-custom-addons
Exit from this environment, type the following command:
$ exit
Create a new configuration file for Odoo 14 and paste the following content into it:
$ sudo nano /etc/odoo14.conf
[options] ; This is the password that allows database operations: admin_passwd = my_admin_passwd db_host = False db_port = False db_user = odoo14 db_password = False addons_path = /opt/odoo14/odoo/addons,/opt/odoo14/odoo-custom-addons
Step 6: Create Systemd Unit files
Create a new service unit file named ‘odoo14.service’ by typing the following command and paste the below content in this file:
$ sudo nano /etc/systemd/system/odoo14.service
[Unit] Description=Odoo14 Requires=postgresql.service After=network.target postgresql.service [Service] Type=simple SyslogIdentifier=odoo14 PermissionsStartOnly=true User=odoo14 Group=odoo14 ExecStart=/opt/odoo14/odoo-venv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf StandardOutput=journal+console [Install] WantedBy=multi-user.target
Now, reload the systemd unit daemon and enable the Odoo 14 services.
$ sudo systemctl daemon-reload
$ sudo systemctl enable --now odoo14
Check the status of Odoo services that they are running or not:
$ sudo systemctl status odoo14
The following output you will retrieve on executing the above command:
To check the Odoo messages logs, use the below-given command on the terminal:
$ sudo journalctl -u odoo14
Step 7: Test the installation of Odoo14
To test the installation, type localhost: 8069 or www.example.com:8069 in your browser and you will see the following interface in your browser:
Conclusion
In the above guide, we have explained how to install and configure the Odoo14 on Ubuntu 20.04 system. Moreover, we have learned how to install required PostgreSQL and wkhtmltopdf packages on your system. Thanks for reading the above article.