How to Install Odoo 17 on Ubuntu 22.04

Odoo 17 is a latest version of Odoo and offers more performance enhancements and an enhanced user interface with new functionality. PostgreSQL and Python 3.10 are required to install it. This article explains how to install and deploy Odoo 17 on Ubuntu 22.04 LTS Server.  

How to Install Odoo 17 on Ubuntu 22.04

How to Install Odoo 17 on Ubuntu 22.04 LTS Server

As we know that, Odoo is a powerful open-source ERP system that integrates various business applications, including CRM, eCommerce, accounting, inventory, and project management. 

Prerequisites

Before you start, ensure that you have the following:
  • A server running Ubuntu 20.04 or higher
  • Access to a terminal with sudo privileges
  • Basic knowledge of command-line operations

Update Your Server

First, update your server to ensure all packages are current. Open a terminal and run the following commands:

sudo apt update
sudo apt upgrade -y

Install PostgreSQL

Odoo uses PostgreSQL as its database. Install PostgreSQL and create a new PostgreSQL user for Odoo:

sudo apt install postgresql -y
sudo -u postgres createuser -s odoo

Install Necessary Dependencies

Odoo requires several dependencies. Install them with the following command:

sudo apt install 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 libpq-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libtiff5-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev -y

Install wkhtmltopdf

wkhtmltopdf is a tool for rendering HTML into PDF and is required by Odoo for printing reports. Install it as follows:

sudo apt install xfonts-75dpi -y
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt -f install -y

Create a System User for Odoo

Create a dedicated system user for running Odoo:

sudo adduser --system --home=/opt/odoo --group odoo

Install Odoo

Clone the Odoo source code from GitHub and install the necessary Python packages:

sudo su - odoo
git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 --single-branch .
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip3 install -r requirements.txt
deactivate

Configure Odoo

Create a configuration file for Odoo:

sudo nano /etc/odoo.conf

Add the following content to the configuration file:

[options]
; This is the password that allows database operations:
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/addons
logfile = /var/log/odoo/odoo.log

Create a Systemd Service File

To manage Odoo as a service, create a systemd service file:

sudo nano /etc/systemd/system/odoo.service

Add the following content:

[Unit]
Description=Odoo
Documentation=http://www.odoo.com

[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo-bin -c /etc/odoo.conf

[Install]
WantedBy=default.target

Start and Enable the Odoo Service

Start the Odoo service and enable it to run at startup:

sudo systemctl start odoo
sudo systemctl enable odoo

Access Odoo

Open your web browser and navigate to `http://localhost:8069` to access the Odoo web interface. You should see the Odoo setup screen where you can create a new database and start configuring your ERP system.

Troubleshooting

If you encounter any issues, check the Odoo log file located at `/var/log/odoo/odoo.log` for more information.

By following these steps, you will have a fully functional Odoo installation on your Ubuntu server. Enjoy exploring the powerful features of Odoo to manage your business processes efficiently!
Feel free to share your experience or ask questions in the comments below.
Previous Post Next Post