Odoo is a powerful open-source ERP system that can transform the way you manage your business. Installing Odoo on Ubuntu may seem complicated, but with our guide you will get through it smoothly and securely. In this article, we will show you how to install and configure Odoo on an Ubuntu server step by step.
Preparing Ubuntu for the Odoo installation
Before installing Odoo on Ubuntu, you need to prepare the operating system properly. We recommend using Ubuntu 20.04 LTS, 22.04 LTS or a newer LTS (Long Term Support) release. The first step is to update all system packages to their latest versions.
Updating the system
Log in to your Ubuntu server and run the following commands:
sudo apt update
sudo apt upgrade -y
These commands ensure that your system is running the latest software versions, which is essential for security and stability.
Installing and configuring PostgreSQL
Odoo uses PostgreSQL as its database management system. This is a key component that must be configured correctly before installing Odoo itself. PostgreSQL should be installed first, because Odoo depends on it.
Installing PostgreSQL
Install PostgreSQL by running:
sudo apt install postgresql postgresql-client -y
Creating a database user
Create a dedicated PostgreSQL user for Odoo:
sudo su - postgres -c "createuser -s odoo"
This user will have superuser privileges, which are necessary for Odoo to manage databases. For production environments, you can additionally set a password for the database user:
sudo su - postgres
psql
ALTER USER odoo WITH PASSWORD 'silne_haslo_bazy_danych';
\q
exit
Installing the required system dependencies
Odoo requires a number of packages and libraries to function properly. Install the necessary dependencies using the following command:
sudo apt install -y 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 nodejs git
Installing wkhtmltopdf
Odoo requires wkhtmltopdf to generate PDF reports. Download and install the recommended version:
sudo apt install wkhtmltopdf -y
For better PDF report quality, you can install the version from the official wkhtmltopdf website with patched Qt enabled:
cd /tmp
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 -y ./wkhtmltox_0.12.6.1-2.jammy_amd64.deb
Installing Odoo on Ubuntu
Now we move on to the actual installation of Odoo. There are several installation methods, but we will present the most recommended one, installation from source, which gives you full control over configuration and updates.
Creating a system user for Odoo
For security reasons, Odoo should run as a dedicated system user without login privileges:
sudo adduser --system --home=/opt/odoo --group odoo
Downloading Odoo from source
Clone the official Odoo repository from GitHub. In this example we are installing Odoo 17.0, but you can choose a different version by changing the number in the --branch parameter:
sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo17
Set the appropriate directory permissions:
sudo chown -R odoo:odoo /opt/odoo
Creating a Python virtual environment
Create a Python virtual environment for Odoo as the odoo user:
sudo su - odoo -s /bin/bash
cd /opt/odoo
python3 -m venv odoo-venv
exit
Install the required Python packages using the virtual environment:
sudo su - odoo -s /bin/bash
source /opt/odoo/odoo-venv/bin/activate
pip install --upgrade pip
pip install wheel
pip install -r /opt/odoo/odoo17/requirements.txt
deactivate
exit
Installing all Python dependencies may take a few minutes. Make sure the process finishes without errors.
Creating directories for custom add-ons
Create a directory for your own and third-party Odoo modules:
sudo mkdir /opt/odoo/custom-addons
sudo chown odoo:odoo /opt/odoo/custom-addons
Configuring Odoo
Once all the necessary components are installed, you need to configure Odoo so that it runs correctly on your Ubuntu server.
Creating the configuration file
Create the configuration directory and the configuration file:
sudo mkdir /etc/odoo
sudo nano /etc/odoo/odoo.conf
The basic configuration should include the following parameters:
[options]
admin_passwd = silnehasło123_ZMIEN_TO
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo17/addons,/opt/odoo/custom-addons
logfile = /var/log/odoo/odoo.log
log_level = info
xmlrpc_port = 8069
proxy_mode = True
Important: Be sure to change the value of admin_passwd to a strong, unique password. This password is used to create, delete and manage databases from the Odoo interface.
If you set a password for the PostgreSQL user, add the parameter:
db_password = twoje_haslo_postgresql
Set the appropriate permissions on the configuration file:
sudo chown odoo:odoo /etc/odoo/odoo.conf
sudo chmod 640 /etc/odoo/odoo.conf
Creating the log file
Create a directory for log files and set the appropriate permissions:
sudo mkdir /var/log/odoo
sudo chown odoo:odoo /var/log/odoo
Running Odoo as a system service
To have Odoo start automatically after a server restart and run in the background, configure it as a systemd service.
Creating the service file
Create the systemd service file:
sudo nano /etc/systemd/system/odoo.service
Add the following configuration:
[Unit]
Description=Odoo ERP System
Documentation=https://www.odoo.com
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo17/odoo-bin -c /etc/odoo/odoo.conf
StandardOutput=journal+console
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Starting the service
Reload the systemd daemon and start the Odoo service:
sudo systemctl daemon-reload
sudo systemctl start odoo
sudo systemctl enable odoo
Check the service status to make sure it is running correctly:
sudo systemctl status odoo
You can also check the logs in real time:
sudo journalctl -u odoo -f
Accessing Odoo in the browser
After a successful installation and service start, Odoo should be available in your browser at:
http://adres_IP_serwera:8069
On first launch you will see the screen for creating a new database. Fill in the required fields:
- Master Password - the password set in the configuration file (admin_passwd)
- Database Name - the name of your database
- Email - the administrator's email address
- Password - the password for the administrator account in Odoo
- Language - select the language (Polish)
- Country - select the country (Poland)
After the database is created, you will be logged in to the system automatically.
Securing your Odoo installation
The security of your Odoo installation on Ubuntu is extremely important, especially if the system will be accessible from the internet. Here are the key security steps.
Configuring the firewall
Configure UFW (Uncomplicated Firewall) to allow connections only on the required ports:
sudo ufw allow 22/tcp
sudo ufw allow 8069/tcp
sudo ufw enable
If you will be using Nginx as a reverse proxy, also add:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
You can then block direct external access to port 8069 and allow it only from localhost:
sudo ufw delete allow 8069/tcp
In the Odoo configuration file, then change:
xmlrpc_interface = 127.0.0.1
Configuring Nginx as a reverse proxy
We recommend using Nginx as a reverse proxy for Odoo, which improves security and performance and enables the use of SSL/TLS. Install Nginx:
sudo apt install nginx -y
Create the configuration file for Odoo:
sudo nano /etc/nginx/sites-available/odoo
Add the basic configuration (replace twoja-domena.pl with your domain):
upstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
server_name twoja-domena.pl www.twoja-domena.pl;
access_log /var/log/nginx/odoo-access.log;
error_log /var/log/nginx/odoo-error.log;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
location /longpolling {
proxy_pass http://odoochat;
}
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
client_max_body_size 100M;
gzip on;
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
}
Enable the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo
sudo nginx -t
sudo systemctl restart nginx
Then install an SSL certificate using Let's Encrypt:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d twoja-domena.pl -d www.twoja-domena.pl
First steps after installation
After successfully installing Odoo on Ubuntu, it is worth getting familiar with the system's basic features. If you want to learn more about installing Odoo in different environments, see our article How to install Odoo step by step.
Once the system is installed, you can start configuring individual modules. Begin with basic features such as customer relationship management in Odoo CRM or Sales module configuration.
For manufacturing companies, the following module will be especially useful: Odoo Manufacturing for production management, and for trading companies - comprehensive warehouse management.
Frequently Asked Questions (FAQ)
What are the system requirements for installing Odoo on Ubuntu?
The minimum requirements are Ubuntu 20.04 LTS or newer (LTS versions recommended), at least 2 GB of RAM (4 GB recommended for small businesses, 8 GB+ for medium and large ones), 40 GB of disk space (more depending on the amount of data), PostgreSQL 12 or newer, and Python 3.8+. For larger installations with many users, significantly more resources are recommended - 16 GB of RAM and a dual-core processor are a reasonable minimum for 10-20 concurrent users.
Can I install Odoo on Ubuntu without technical knowledge?
Installing Odoo on Ubuntu requires a basic knowledge of the Linux command line, server administration, permission management and system service configuration. If you have no technical experience, we recommend getting help from a professional Odoo partner, who will carry out the installation and configuration in line with security and performance best practices. Alternatively, you can consider Odoo.sh - the official Odoo cloud platform.
How long does it take to install Odoo on Ubuntu?
The Odoo installation itself on Ubuntu, following this guide, usually takes from 45 minutes to 2 hours, depending on the installer's experience, internet connection speed and server specifications. However, keep in mind that the full system setup, installing and configuring modules, adapting the system to your company's needs, data migration and user training can take from several days to several weeks.
How do I upgrade Odoo to a newer version?
Upgrading Odoo requires downloading the new version from the GitHub repository, updating the Python dependencies, backing up the database and running the upgrade process with the -u all parameter. This process is more complicated than installation, and we recommend performing it in a test environment before upgrading production. It is also worth getting help from an Odoo partner, especially for major version upgrades (e.g. from 16.0 to 17.0).
Can I run multiple Odoo instances on one server?
Yes, you can run multiple Odoo instances on a single Ubuntu server. Each instance requires a separate configuration file with a different port, a separate system user (optionally) and a separate systemd service. You can also use the same PostgreSQL server, but with separate databases. Nginx can be configured to serve multiple domains pointing to different instances.
Summary
Installing Odoo on Ubuntu is a process that requires attention and precision, but with our guide you are able to carry it out on your own. Remember the most important steps: installing PostgreSQL, creating a dedicated system user, correctly configuring the Python virtual environment, and securing the installation with a firewall and a reverse proxy.
Regular system maintenance is also key - Ubuntu and Odoo updates, regular database backups (both PostgreSQL and files), and monitoring of server performance, system logs and disk space. We also recommend configuring automatic backups and testing data recovery procedures.
If you need professional support with installing, configuring or implementing Odoo in your company, contact KK Innovations. Our team of experts has many years of experience implementing Odoo systems and will help you make full use of the potential of this powerful ERP tool. We offer comprehensive services - from installation, through configuration and customization, to training and ongoing technical support. Get in touch - together we will find the optimal solution for your business!