Business software

Install Odoo on Ubuntu: PostgreSQL, Nginx and HTTPS Step by Step

Install Odoo from Odoo's own apt repository on Ubuntu 24.04, put Nginx and a Let's Encrypt certificate in front, and apply the production settings Odoo documents.

By EpiFive Editorial TeamReviewed/updated 11 min readHow we check our guides

This article contains affiliate links. If you buy through them, EpiFive may earn a commission at no extra cost to you. Details.

On this page

You can install Odoo on Ubuntu 24.04 in a few commands: add Odoo's apt repository, install PostgreSQL, run apt install odoo, and open port 8069. For a server your team will really use, you then put Nginx in front of it with a free Let's Encrypt certificate and set the production options Odoo documents (proxy_mode, workers, dbfilter, list_db and a random admin_passwd). This guide walks through all of it in order.

Who this is for and what you will have at the end

This guide is for IT administrators, small-business owners with a technical person on hand, and students who want a working Odoo server they own. You need basic comfort with a Linux shell and a domain name you control.

At the end you will have:

  • Odoo installed from Odoo's own package repository, running as a service.
  • PostgreSQL as its database.
  • Nginx serving Odoo on HTTPS with a certificate that renews itself.
  • The production settings from Odoo's deployment documentation applied.
  • A short troubleshooting list for the problems people hit most.

If you are still deciding which edition fits, read Odoo Community vs Enterprise first. If you are planning the whole project rather than the server, ERP implementation phases and timeline covers the work around the install.

Prerequisites

ItemWhat you need
ServerUbuntu 24.04 LTS, because Odoo's installation page says the current deb package supports Ubuntu Noble
AccessA user with sudo rights
DomainA name such as erp.contoso.com pointing (A record) at the server's public IP
Ports80 and 443 reachable from the internet (80 is needed for the certificate check and the redirect)
EditionCommunity. Odoo's page says there is currently no nightly repository for Enterprise

Odoo's source-install page lists Python 3.10 or later and PostgreSQL 13 or above as requirements. Ubuntu 24.04 ships newer versions of both, and the package pulls in what it needs. The same page notes that the pgvector extension, needed for Odoo's AI features, is available only for PostgreSQL 15 and up, so if you plan to use those features, check your PostgreSQL version.

Update the server before you start:

sudo apt update && sudo apt upgrade -y

Step 1: Install PostgreSQL

Odoo stores everything in PostgreSQL. Odoo's package documentation gives this command for Debian and Ubuntu:

sudo apt install postgresql -y

Check that the service is running:

systemctl status postgresql

You should see active in the output. You do not need to create the Odoo database user yourself on this route: Odoo's page says the deb package creates the necessary PostgreSQL user and starts the server.

Step 2: Add Odoo's repository and install Odoo

Odoo documents a signed apt repository on nightly.odoo.com. Add the signing key, then the repository. Replace {CURRENT_MAJOR_BRANCH} with the branch shown on Odoo's installation page for the version you want (for example the number of the current major release); do not guess it, since the page fills it in for the version you are reading.

wget -q -O - https://nightly.odoo.com/odoo.key | sudo gpg --dearmor -o /usr/share/keyrings/odoo-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/odoo-archive-keyring.gpg] https://nightly.odoo.com/{CURRENT_MAJOR_BRANCH}/nightly/deb/ ./' | sudo tee /etc/apt/sources.list.d/odoo.list

Then install:

sudo apt-get update && sudo apt-get install odoo

Odoo notes that nightly packages may be hard to keep up to date. To stay current, run sudo apt-get upgrade regularly, and plan a test of every upgrade on a copy first.

Odoo's page also says the package starts the server automatically. Confirm it is running (the Fedora steps on the same page use the service name odoo, and the deb package installs Odoo as a service; confirm the name with the second command if the first fails):

systemctl status odoo
systemctl list-units --type=service | grep -i odoo

Check it answers on port 8069

Odoo's documentation says that once the server starts you open http://localhost:8069 in a browser. From the server itself, you can test without a browser:

curl -I http://localhost:8069

Any HTTP response (including a redirect to a database screen) means the server is up. Do not open port 8069 to the internet; Nginx will be the only public entrance.

Step 3: Find and edit the configuration file

Odoo's deployment page lists the configuration file locations: /etc/odoo.conf for a package installation and ~/.odoorc for a source installation. Confirm what your package created:

ls -l /etc/odoo*

Open the file that exists with sudo nano. All the options below go under the [options] section. Make a copy first:

sudo cp /etc/odoo.conf /etc/odoo.conf.bak

If your package placed the file elsewhere, use that path in every command in this guide.

Set a random master password

admin_passwd protects the database manager screens. Odoo says it can only be set in the configuration file and should be a randomly generated value. Odoo's documentation gives this command to generate one:

python3 -c 'import base64, os; print(base64.b64encode(os.urandom(24)))'

Put the result in the file:

admin_passwd = <the generated value>

Store it in your password manager. If you lose it, Odoo documents a reset: replace the hashed admin_passwd line with a temporary plain-text value (do not just comment it out with ;), restart Odoo, open /web/database/manager, choose Set Master Password, enter the temporary value and then the new one. Odoo hashes the new password into the file.

Turn on proxy mode

Odoo says to set proxy_mode = True only when it runs behind a reverse proxy, so it uses the forwarded hostname, scheme and client IP. You are about to add Nginx, so set it:

proxy_mode = True

Step 4: Create the first database

Open Odoo in a browser to reach the database screen. Until Nginx is set up, reach it through an SSH tunnel from your own computer rather than exposing the port:

ssh -L 8069:localhost:8069 [email protected]

Then browse to http://localhost:8069 on your computer. Odoo shows a database creation form. Enter:

  • The master password you generated.
  • A database name (for example contoso).
  • An administrator email and a strong password. Odoo's security advice is to avoid default logins like admin and never use default passwords, even on test systems.
  • Leave the demo data option off. Odoo's guidance is not to install demo data on internet-facing servers.

Step 5: Put Nginx in front with HTTPS

Odoo's documentation is direct: it sends authentication data in cleartext, so production deployments must use HTTPS through an SSL termination proxy, redirect plain HTTP to HTTPS and send a Strict-Transport-Security header with a one-year max-age.

Install Nginx:

sudo apt install nginx -y

Get the certificate first, using Certbot's official snap instructions for Nginx on Linux:

sudo apt-get remove certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/local/bin/certbot

Create a minimal site file at /etc/nginx/sites-available/odoo.conf first, so Certbot has a server name to match:

server {
    listen 80;
    server_name erp.contoso.com;
}

Enable it and reload Nginx:

sudo ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/sites-enabled/odoo.conf
sudo nginx -t && sudo systemctl reload nginx

Now request the certificate. certonly gets the certificate without editing your files, which suits a configuration you write yourself:

sudo certbot certonly --nginx

Follow the prompts, choosing erp.contoso.com. Test automatic renewal, as Certbot's page recommends:

sudo certbot renew --dry-run

The Nginx site file

Odoo's sample configuration has upstreams for the main server on port 8069 and the live chat server on port 8072, an HTTP-to-HTTPS redirect, a TLS 1.2 server block with 720-second proxy timeouts, a /websocket location sent to the chat upstream, and X-Forwarded-* headers. The file below follows that structure. Compare it with the current sample on Odoo's deployment page before you use it.

upstream odoo {
    server 127.0.0.1:8069;
}
upstream odoochat {
    server 127.0.0.1:8072;
}
 
server {
    listen 80;
    server_name erp.contoso.com;
    return 301 https://$host$request_uri;
}
 
server {
    listen 443 ssl;
    server_name erp.contoso.com;
 
    ssl_certificate     /etc/letsencrypt/live/erp.contoso.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/erp.contoso.com/privkey.pem;
    ssl_protocols       TLSv1.2 TLSv1.3;
 
    proxy_read_timeout    720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout    720s;
 
    add_header Strict-Transport-Security "max-age=31536000" always;
 
    location /websocket {
        proxy_pass http://odoochat;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        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_pass http://odoo;
        proxy_set_header Host $host;
        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;
        proxy_redirect off;
    }
}

Odoo's sample also marks the session_id cookie Secure and SameSite=Lax, which needs nginx 1.19.8 or later; copy that part from the sample on Odoo's page. Replace the file contents, then test and reload:

sudo nginx -t && sudo systemctl reload nginx

Open https://erp.contoso.com. You should see the Odoo login page with a valid certificate.

Step 6: Apply the production settings

Back in the Odoo configuration file, add the settings Odoo documents for production.

Restrict the databases

Odoo's dbfilter selects which database serves a request by hostname. Once db_name and dbfilter each match a single database per hostname, Odoo says to set list_db = False, which hides the database list and blocks the database manager screens:

db_name = contoso
dbfilter = ^contoso$
list_db = False

Size the workers

Odoo's rule of thumb is (CPU count x 2) + 1 workers, with cron workers needing CPU too, and roughly 1 worker per 6 concurrent users. Its worked example: 4 CPUs and 60 users gives 8 workers plus 1 cron worker and about 3 GB of RAM, using the formula workers x ((light ratio x about 150 MB) + (heavy ratio x about 1 GB)) with 80% light and 20% heavy requests. Check the arithmetic yourself: 9 x ((0.8 x 150) + (0.2 x 1024)) = 9 x (120 + 204.8) = 2,923.2 MB, about 3 GB.

Odoo's sample settings are:

workers = 8
max_cron_threads = 1
limit_memory_hard = 1677721600
limit_memory_soft = 629145600
limit_request = 8192
limit_time_cpu = 600
limit_time_real = 1200

Scale workers to your own CPU count. When workers are on, Odoo runs a live chat worker on the gevent port, which is why the Nginx file sends /websocket to port 8072. Odoo's documentation shows --gevent-port; if live chat or the websocket does not connect after you enable workers, check that page for the option matching your version.

Restart Odoo:

sudo systemctl restart odoo

Verification checklist

  1. https://erp.contoso.com loads with a valid certificate, and http://erp.contoso.com redirects to it.
  2. curl -I http://erp.contoso.com:8069 from outside the server fails, because the port is not public.
  3. /web/database/manager no longer works once list_db = False is set.
  4. sudo certbot renew --dry-run succeeds.
  5. You can log in as your administrator and install one app.

Troubleshooting

  • 502 Bad Gateway from Nginx. Odoo is not running or is not on port 8069. Check systemctl status odoo and the Odoo log.
  • The database list or manager still shows. list_db = False only takes effect after a restart, and it needs db_name or a dbfilter that matches one database.
  • Login redirects loop or links use http://. proxy_mode = True is missing, or Nginx is not sending X-Forwarded-Proto.
  • Certificate errors after a few months. Odoo says to keep a valid certificate in place at all times. Run the dry-run renewal test and read the Certbot log.
  • Websocket or live chat does not connect. The /websocket location must reach the chat worker; this needs workers greater than zero.
  • Out-of-memory kills. Reduce workers or add RAM, using the formula above.

Keep it safe

Odoo's security advice includes: use unique strong passwords for every admin account, run the PostgreSQL user without superuser rights, keep Odoo updated, lock down SSH with key-only authentication and consider fail2ban, and back up databases and the filestore regularly to a server the Odoo host cannot reach. For database backups, PostgreSQL backups with pgBackRest covers one option; remember Odoo also needs its filestore, so a database dump alone is not a full backup.

See also

What we checked

  • Opened Odoo's package installation source (the documentation repository file for the on-premise packages page) on 2026-11-29: the apt key and repository commands, apt install postgresql, the Ubuntu Noble (24.04 LTS) support note, and the statement that there is no nightly Enterprise repository.
  • Opened Odoo's deployment source on 2026-11-29: dbfilter, list_db, admin_passwd generation and reset, proxy_mode, the worker rule of thumb, the sample limits and the HTTPS and security guidance.
  • Cross-checked the configuration file path: the deployment page lists /etc/odoo.conf for package installs, while the packages page does not name it, so the guide tells you to confirm it with ls /etc/odoo*.
  • Opened Odoo's source-install page on 2026-11-29 for the Python 3.10+ and PostgreSQL 13+ requirements and the http://localhost:8069 address.
  • Opened Certbot's official instructions for Nginx on Linux (snap) on 2026-11-29 and copied the install, certonly and renew --dry-run commands.
  • Recalculated Odoo's RAM example: 9 workers x ((0.8 x 150 MB) + (0.2 x 1024 MB)) = 2,923.2 MB, about 3 GB.
  • Not checked: nothing was installed on a server for this article, and the Nginx file is written to follow the structure Odoo describes rather than copied verbatim. The {CURRENT_MAJOR_BRANCH} value, the exact service name and the config path should be confirmed on your own server. Steps follow Odoo's documentation as of 2026-11-29.

Last tested: 2026-11-29

References

Questions people ask

Which Ubuntu version does the Odoo deb package support?

Odoo's installation page says the current deb package supports Ubuntu Noble, which is 24.04 LTS. Check that page before you install, because the supported release changes with each Odoo major version.

Where is the Odoo configuration file on a package install?

Odoo's deployment documentation lists /etc/odoo.conf for a package installation and ~/.odoorc for a source installation. Run ls /etc/odoo* on your server to confirm which path your package created before you edit it.

Do I need Nginx in front of Odoo?

Odoo's documentation says production deployments must use HTTPS through an SSL termination proxy, because Odoo sends authentication data in cleartext. Nginx is the proxy Odoo's own sample configuration uses, so it is the simplest choice to follow.

Is Odoo Community free to install on my own server?

Odoo Community is the open-source edition you can run yourself. Odoo's pricing page also lists an on-premise option under its Custom plan, and there is currently no nightly apt repository for the Enterprise edition, so the repository steps here are for the Community edition.

OdooUbuntuPostgreSQLNginxCertbot