
A Step-by-Step Guide to Installing Odoo 18 on Ubuntu 22.04+
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.
1sudo 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.
1sudo 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.
1sudo adduser --system --home=/opt/odoo --group odoo2sudo 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.
1sudo 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-less2sudo ln -s /usr/bin/nodejs /usr/bin/node3sudo npm install -g less less-plugin-clean-css4sudo 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:
1sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb2sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb3sudo 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.
1sudo su - odoo18 -s /bin/bash2git clone https://www.github.com/odoo/odoo --depth 1 --branch 18.0 /opt/odoo/odoo-server3python3 -m venv venv4source venv/bin/activate5pip install --upgrade pip6pip3 install wheel7pip3 install -r odoo-server/requirements.txt8deactivate9exit
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.
1sudo mkdir -p /var/log/odoo2sudo chown odoo:odoo /var/log/odoo3sudo nano /etc/odoo-server.conf4sudo mkdir -p /opt/odoo/custom-addons5sudo chown odoo:odoo /opt/odoo/custom-addons
Paste the following content, adjusting the admin_passwd and other settings as needed:
1[options]2admin_passwd = your_secure_password3db_host = False4db_port = False5db_user = odoo6db_password = False7addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/custom-addons8logfile = /var/log/odoo/odoo-server.log
Save and close the file. Then, set the appropriate permissions.
1sudo chown odoo: /etc/odoo-server.conf2sudo 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.
1sudo nano /etc/systemd/system/odoo-server.service
Add the following content to the file:
Save and close the file. Reload the systemd daemon and enable and start the service.
1sudo systemctl daemon-reload2sudo 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.
1# Example commands for a typical bash script installation2sudo wget https://raw.githubusercontent.com/HeliconiaIO/InstallScript/18.0/odoo_install.sh3sudo chmod +x odoo_install.sh4sudo ./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.
1# Example commands for a CLI tool installation2sudo npm install -g install-odoo3install-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.
Read Next

Ensure data security with Odoo Database Auto Backup on Linux. Effortless and space-efficient backup strategy for uninterrupted business operations.

Confused by Odoo hosting options? Cloud, dedicated, or self-hosted? We explain Odoo Online, Odoo.sh, & On-Premise to find your perfect fit