Odoo is a suite of business management software tools including, for example, CRM, e-commerce, billing, accounting, manufacturing, warehouse, project management, and inventory management.
In this tutorial we will demonstrate how to install Odoo 14 on Ubuntu 20.04. The most preferred setup environment for Odoo 14 is through virtual environment but you can also deploy Odoo 14 as a Docker container.
In this tutorial we will focus on the virtual environment setup.
Let us start with the installation.
1. Updating the system
sudo apt update -y && apt upgrade -y
2. Installing Python Dependencies
Since Odoo14 is built with Python we need to install all the Odoo14 dependencies on Python.
sudo apt install python3-dev nodejs git build-essential node-less npm python3-pip python3-venv python3-wheel python3-setuptools libjpeg-dev libpq-dev liblcms2-dev libwebp-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev libldap2-dev libsasl2-dev libxslt1-dev zlib1g-dev
3. Installing the Database
The default database used in Odoo is PostgreSQL. Let us install PostgreSQL.
sudo apt install postgresql -y
Check the version of PostgresSQL.
# psql --version
psql (PostgreSQL) 12.9 (Ubuntu 12.9-0ubuntu0.20.04.1)
Check the status.
systemctl status postgresql
4. Creating System and PostgreSQL user
Let us create a Odoo14 user set the home directory to /opt/odoo14.
sudo useradd -m -d /opt/odoo14 -U -r -s /bin/bash odoo14
Create a PostgreSQL user and we will named it odoo14.
sudo su - postgres -c "createuser -s odoo14"
5. Installing wkhtmltopdf
Wkhtmltopdf is an open source command line tool that render HTML into PDF format using the Qt WebKit rendering engine. This tool is necessary for printing PDF reports in Odoo.
Let us download and install wkhtmltopdf 0.12.5.
sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
Make it executable.
chmod +x wkhtmltox_0.12.5-1.bionic_amd64.deb
Let’s Install it.
sudo apt install ./wkhtmltox_0.12.5-1.bionic_amd64.deb
6. Odoo 14 installation and configuration
Switch to user odoo14.
su - odoo14
Cloning Odoo14 repository from Github.
git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo14/odoo
Go to the Odoo 14 directory.
cd /opt/odoo14
Create a virtual environment for your Odoo 14 application.
python3 -m venv myodoo-venv
Activate the virtual environment.
source myodoo-venv/bin/activate
Let us install the Odoo dependencies. The Python modules needed to run Odoo 14 is set in the requirements.txt file. To install it run the following command.
(myodoo-venv) $ pip3 install wheel
(myodoo-venv) $ pip3 install -r odoo/requirements.txt
After installing the dependencies we need to deactivate the virtual environment.
(myodoo-venv) $ deactivate
Now we need to create an Addons directory for third party addons.
mkdir /opt/odoo14/custom-addons
Let’s exit to odoo14 user and go back to our sudo user.
exit
Let us create the Odoo14 configuration file.
sudo nano /etc/odoo14.conf
Add the content below.
[options]
; This is the password that allows database operations:
admin_passwd = admin_password
db_host = False
db_port = False
db_user = odoo14
db_password = False
xmlrpc_port = 8069
logfile = /var/log/odoo14/odoo.log
addons_path = /opt/odoo14/odoo/addons,/opt/odoo14/custom-addons
Please make sure to change the “admin_password” to your preferred password, then save and close the file.
Next, we need to create a the log directory for our Odoo 14 instance.
mkdir /var/log/odoo14
Set the ownership to odoo14.
chown odoo14:root /var/log/odoo14
7. Create a Odoo 14 Systemd Service
To manage our Odoo 14 we need to create a systemd file.
sudo nano /etc/systemd/system/odoo14.service
Add the following.
[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/myodoo-venv/bin/python3 /opt/odoo14/odoo/odoo-bin -c /etc/odoo14.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Save and close the file and reload the systemd daemon to apply the changes:
sudo systemctl daemon-reload
Start and enable the Odoo14 service.
sudo systemctl enable --now odoo14
Check the status of the Odoo14 service.
systemctl status odoo14
Congratulations, you can now access your Odoo 14 application at http://ipaddress:8069
Conclusion
In this tutorial you have learned how to install Odoo 14 on Ubuntu 20.04. If you like this article you might like also our article on Odoo 13 and Odoo 15
If you have questions, feel free to leave a comment and we will try to answer it.
Thank you and hope you enjoy our tutorial ?