Skip to main content

Odoo

A Step-by-Step Guide to Installing Odoo 18 on Ubuntu 22.04+

Learn to manually install Odoo 18 on Ubuntu 22.04 and above. This guide provides step-by-step instructions for a clean and controlled setup.

By Atul Makwana · · 3 min read

How to Install Odoo 18 on Ubuntu 22.04 Step-by-Step

Odoo is a powerful, all-in-one business management software with a comprehensive suite of applications for various business needs, including CRM, accounting, inventory, and more. This guide provides a detailed walkthrough for installing Odoo 18 on an Ubuntu 22.04 server and above.

Prerequisites

Before you begin, ensure your system meets the following requirements:

  • An Ubuntu 22.04+ server with at least 2GB of RAM and a 2-core CPU.
  • SSH access to the server with sudo privileges.

Step 1: Update System Packages

Start by updating and upgrading your server's package list to ensure all existing packages are up to date.

bash
sudo apt-get update && sudo apt-get upgrade -y

Step 2: Install PostgreSQL

Odoo uses PostgreSQL as its database backend. Install it and start the service.

bash
sudo apt-get install postgresql -y

After installation, you can verify the service status with: systemctl status postgresql

Step 3: Create a System User and PostgreSQL User

For security, it's best to run Odoo under a dedicated system user, not as the root user. Create a system user named odoo and a corresponding PostgreSQL user with the same name.

bash
sudo adduser --system --home=/opt/odoo --group odoo
sudo su - postgres -c "createuser -s odoo"

Step 4: Install Required Dependencies

Odoo is built on Python, and it requires several dependencies to run correctly. Install the necessary packages.

bash
sudo apt-get install -y git python3-pip python3-dev python3-venv libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev npm node-less
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less less-plugin-clean-css
sudo python3 -m pip install libsass

Step 5: Install Wkhtmltopdf

Wkhtmltopdf is an essential tool for generating PDF reports in Odoo. Odoo 18 requires a specific version. Download and install it using the following commands:

bash
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo apt install -f

Step 6: Clone Odoo 18 from GitHub and Set Up a Virtual Environment

Switch to the odoo user and clone the Odoo 18 source code from its official GitHub repository. It's recommended to install the Python dependencies in a virtual environment.

bash
sudo su - odoo18 -s /bin/bash
git clone https://www.github.com/odoo/odoo --depth 1 --branch 18.0 /opt/odoo/odoo-server
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip3 install wheel
pip3 install -r odoo-server/requirements.txt
deactivate
exit

Step 7: Create the Odoo Configuration File

Create a configuration file to define Odoo's settings, such as the database user, host, and addons path.

bash
sudo mkdir -p /var/log/odoo
sudo chown odoo:odoo /var/log/odoo
sudo nano /etc/odoo-server.conf
sudo mkdir -p /opt/odoo/custom-addons
sudo chown odoo:odoo /opt/odoo/custom-addons

Paste the following content, adjusting the admin_passwd and other settings as needed:

ts
[options]
admin_passwd = your_secure_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/custom-addons
logfile = /var/log/odoo/odoo-server.log

Save and close the file. Then, set the appropriate permissions.

bash
sudo chown odoo: /etc/odoo-server.conf
sudo chmod 640 /etc/odoo-server.conf

Step 8: Create a Systemd Service File

To manage Odoo as a service, create a systemd unit file that allows you to start, stop, and restart the application easily.

bash
sudo nano /etc/systemd/system/odoo-server.service

Add the following content to the file:

bash

Save and close the file. Reload the systemd daemon and enable and start the service.

bash
sudo systemctl daemon-reload
sudo systemctl enable --now odoo-server.service

Step 9: Access Odoo

Once the service is active, you can access your Odoo instance by navigating to your server's IP address or domain on port 8069.

http://your_server_ip:8069

Alternative Installation Methods

While the manual installation provides a great understanding of the system, you can also use automated scripts to streamline the process.

Using a Bash Script: Many Odoo developers create scripts that automate the entire installation process. A popular odoo 18 install script from a company like HeliconiaIO can be downloaded and run with a few commands, handling all dependencies, users, and service configuration for you. You typically just need to configure a few variables at the top of the script.

bash
# Example commands for a typical bash script installation
sudo wget https://raw.githubusercontent.com/HeliconiaIO/InstallScript/18.0/odoo_install.sh
sudo chmod +x odoo_install.sh
sudo ./odoo_install.sh

Using install-odoo CLI: For those who prefer a command-line interface (CLI) tool, a Node.js package like install-odoo can manage the setup. This method simplifies the process, particularly for developers who are already using Node.js and npm. You would install the CLI tool globally and then use a single command to install a new Odoo instance.

bash
# Example commands for a CLI tool installation
sudo npm install -g install-odoo
install-odoo --version 18.0 --path /opt/odoo --user odoo

While this guide provides a solid foundation for a self-hosted setup, the journey to a fully optimized business management system is just beginning. For expert Odoo implementation, bespoke development, seamless data migration, and robust deployment services, consider partnering with a team that has deep expertise. Contact Heliconia Solutions to transform your Odoo instance into a powerful, customized solution tailored to your business needs.

Newsletter

One Email When Something Is Worth Reading

New articles and the occasional project note. No schedule, no filler, unsubscribe in one click.

Subscribe to the newsletter

Double opt-in. Unsubscribe in one click, never sold.

Next step

Working Through the Same Question?

Tell us where you are. An engineer will answer, and point you at the closest project.