Odoo is a popular open-source business management software suite that encompasses a wide range of applications, from customer relationship management (CRM) to human resources, accounting, e-commerce, and more. With the release of Odoo 17, it brings numerous improvements and new features to enhance your business operations. In this blog, we will guide you through the process of installing Odoo 17 on Ubuntu 22.04 LTS server.
Odoo 17 introduces several enhancements and optimizations, including improved performance, a more user-friendly interface, and additional functionality to streamline your business processes. Whether you're a small business owner looking to manage your operations more efficiently or a developer interested in working with the latest Odoo version, this installation guide will help you get started.
Step 1 : Update and Upgrade System Packages
it is always recommended to update and upgrade the system to the latest version.
sudo apt update
sudo apt upgrade
Step 2 : Install PostgreSQL
Odoo requires a PostgreSQL database to store its data
sudo apt-get install postgresql -y
Step 3 : Create a PostgreSQL User
Create a PostgreSQL user with the name odoo17 and grant it superuser privileges.
sudo su - postgres -c "createuser -s odoo17" 2> /dev/null || true
Step 4 : Set a Password for the PostgreSQL
sudo -u postgres psql -c "ALTER USER odoo17 PASSWORD 'odoo';" 2> /dev/null || true
Step 5 : Create a System User for Odoo
Create a system user with the name odoo and add it to the sudo group.
sudo adduser --system --quiet --shell=/bin/bash --home=/opt/odoo --gecos 'ODOO' --group odoo
sudo adduser odoo sudo
Step 6 : Install Required Dependencies
Odoo requires several dependencies to be installed on the system.
sudo apt-get install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libjpeg-dev gdebi -y
sudo apt-get install libpq-dev python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev python3-psutil python3-polib python3-dateutil python3-decorator python3-lxml python3-reportlab python3-pil python3-passlib python3-werkzeug python3-psycopg2 python3-pypdf2 python3-gevent -y
Step 7 : Install Node.js and Less
Odoo requires Node.js and Less to be installed on the system.
sudo apt-get install nodejs npm -y
sudo npm install -g rtlcss
Step 8 : Install wkhtmltopdf
wkhtmltopdf is used to convert html content into pdf format. Odoo
generates the reports in html format and this is then converted to pdf
using the wkhtmltopdf package.
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb
sudo apt install ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb
Step 9 : Create a Log Directory for Odoo
Create a log directory for Odoo and change its ownership to the odoo user.
sudo mkdir /var/log/odoo
sudo chown odoo:odoo /var/log/odoo
Step 10 : Clone Odoo Repository to Server
Clone the Odoo17 repository to the /opt/odoo/odoo17/server-code directory and change its ownership to the odoo user.
sudo git clone --depth 1 --branch 17.0 https://github.com/odoo/odoo /opt/odoo/odoo17/server-code
sudo chown -R odoo:odoo /opt/odoo
Step 11 : Create an Odoo Configuration File
Create an Odoo configuration file at /etc/odoo17.conf with the following contents:
sudo nano /etc/odoo17.conf
[options];
Database operations password:
admin_passwd = PASSWORD
db_host = localhost
db_user = odoo17
db_password = odoo
http_port = 8069
logfile = /var/log/odoo/odoo17-server.log
data_dir = /opt/odoo/odoo17/.local/share/Odoo
addons_path = /opt/odoo/odoo17/server-code/addons
Replace PASSWORD with a strong password for the database operations.
Step 12 : Change the Ownership and Permissions
Change the Ownership and Permissions of the Configuration File Change the ownership of the configuration file to the odoo user and set its permissions to 640.
sudo chown odoo:odoo /etc/odoo17.conf
sudo chmod 640 /etc/odoo17.conf
Step 13 : Create a Python Virtual Environment for Odoo
Create a Python virtual environment for Odoo and activate it.
sudo -u odoo -i
cd odoo17
python3 -m venv odoo-venv
source odoo-venv/bin/activate
Step 14 : Install Required Python Packagess
pip3 install wheel setuptools pip --upgrade
pip install -r server-code/requirements.txt
Step 15 : Deactivate the Virtual Environment
deactivate
Step 16 : Create a Systemd Service for Odoo
Create a systemd service for Odoo at /etc/systemd/system/odoo17.service with the following contents:
sudo nano /etc/systemd/system/odoo17.service
[Unit]
Description=Odoo17
Requires=postgresql.service
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo17/odoo-venv/bin/python3.10 /opt/odoo/odoo17server-code/odoo-bin -c /etc/odoo17.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target
Step 17 : Change the Ownership and Permissions
Change the ownership of the service file to root and set its permissions to 755.
sudo chmod 755 /etc/systemd/system/odoo17.service
sudo chown root: /etc/systemd/system/odoo17.service
Step 18 : Service Commands
sudo systemctl start odoo17.service
sudo systemctl status odoo17.service
sudo systemctl restart odoo17.service
sudo systemctl daemon-reload
Step 19 : Enable the Odoo service on system startup
sudo systemctl enable odoo17.service
Congratulations! You have successfully installed Odoo17 on Ubuntu 22.02 LTS server. You can now access Odoo by opening a web browser and navigating to http://SERVER_IP:8069.