Self-Host Odoo 19 on Ubuntu 24.04
Odoo,  How To

How to install Odoo 19 on Ubuntu 24.04

Date Published

Date Updated

Share This

Self-hosting Odoo gives you full control over data, and custom modules. This guide walks you through a safe, maintainable install of Odoo 19 on Ubuntu 24.04, covering both Community and Enterprise editions, an easy CLI installer (install-odoo), configuration, HTTPS, your instance runs reliably in production.

Key references used: Odoo official docs (install paths & packaging), the install-odoo CLI project, and practical server-deployment tutorials.

Quick overview — what you’ll do

  1. Prepare the Ubuntu 24.04 server (users, updates, firewall).
  2. Install PostgreSQL and system packages.
  3. Install Odoo 19 (two options: recommended manual/source method or quick CLI with install-odoo).
  4. Configure systemd and Nginx reverse proxy with HTTPS.
  5. Optionally add Enterprise addons (requires Odoo subscription and enterprise repo access). Odoo Source

Prerequisites (what you need before starting)

  • An Ubuntu 24.04 server (fresh or dedicated VM).
  • A non-root sudo user (recommended).
  • Minimum recommended hardware for small production: 4 vCPU, 8–16 GB RAM, 100+ GB SSD. Increase for many users/modules. (real world deployments often use 4+ GB RAM as absolute minimum).
  • Domain name pointing to the server (for HTTPS).
  • Odoo Enterprise: valid subscription and access to the enterprise addons / repository if you plan to enable Enterprise features.
  • (Optional but recommended) Node.js (for JS build assets) and wkhtmltopdf 0.12.6 for PDF headers/footers.

Recommended PostgreSQL version

Odoo requires PostgreSQL. Recent community guides and deployments recommend using modern PostgreSQL (15 or 16) for best compatibility and performance with Odoo 19; the packaged installers default to the distro PostgreSQL package. Use the distribution package unless you have a specific reason to compile/customize.

Option A

Quick install using the install-odoo CLI (fast & repeatable)

install-odoo is a CLI helper that automates many common tasks (user creation, PostgreSQL, dependencies, Odoo clone, systemd, nginx). It’s useful for a fast, consistent setup.

  1. Install Node.js & npm (if not installed)
1
sudo apt update
2
sudo apt install -y nodejs npm
3
# (Or install Node.js 18+ from nodesource for recommended node versions)
  1. Run the installer (interactive)
1
npx install-odoo

npx install-odoo will prompt for options: Odoo version (choose 19.0), install Community or Enterprise, PostgreSQL config, domain, SSL (LetsEncrypt) options, etc. The tool supports Ubuntu 22.04 and 24.04.

  1. After completion:
  • The installer typically creates an odoo system user, clones the specified Odoo branch, sets up a Python venv, installs dependencies, configures systemd, and generates an Nginx config with HTTPS if you chose that option.
  • Verify service:
1
sudo systemctl status odoo-server.service
2
# or check the service name printed by the installer

Notes:

  • The CLI speeds setup and is great for dev/test or small production — but review generated configs and secrets before going to production.
  • If you choose Enterprise, the installer may ask for your Enterprise repository credentials or expect you to have them available.

Option B

Manual (recommended for full control / production)

If you need precise control or must integrate custom modules, follow these manual steps.

  1. System update and create user
1
sudo apt update && sudo apt upgrade -y
2
sudo adduser --system --home=/opt/odoo --group --shell=/bin/bash odoo
  1. Install PostgreSQL and create DB user
1
sudo apt install -y postgresql postgresql-contrib postgresql-16-pgvector
2
sudo -u postgres createuser --createdb --username postgres --no-createrole --pwprompt odoo
3
# Follow prompts to set password for user 'odoo'
  1. Install system packages & Python venv
1
sudo apt install -y git python3-venv python3-pip build-essential wget \
2
python3-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \
3
libjpeg-dev zlib1g-dev libpq-dev nodejs npm node-less
4
5
sudo ln -s /usr/bin/nodejs /usr/bin/node
6
7
sudo npm install -g less less-plugin-clean-css
  1. wkhtmltopdf (for PDF reports with headers/footers)
1
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
2
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
3
sudo apt install -f
  1. Clone Odoo 19 source and set up virtualenv
1
sudo -u odoo -H bash -c '
2
cd /opt/odoo
3
git clone --depth 1 --branch 19.0 https://github.com/odoo/odoo.git odoo-server
4
python3 -m venv venv
5
source venv/bin/activate
6
pip install --upgrade pip
7
pip install -r /opt/odoo/odoo-server/requirements.txt
8
'

FOR ENTERPRISE ONLY

if you wanted to deploy the odoo enterprise you can clone it too.

1
sudo -u odoo -H bash -c '
2
mkdir -p /opt/odoo/enterprise
3
cd /opt/odoo/enterprise
4
git clone --depth 1 --branch 19.0 https://github.com/odoo/enterprise.git addons'

Note: To clone and install the Odoo Enterprise version, you must be an official Odoo partner and have authorized access to https://github.com/odoo/enterprise.

  1. Create odoo-server.conf (example) and log directory
1
sudo nano /etc/odoo-server.conf

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

1
[options]
2
admin_passwd = your_secure_password
3
db_host = False
4
db_port = False
5
db_user = odoo
6
db_password = False
7
addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/custom-addons
8
; uncomment below if you are using odoo enterprise
9
;addons_path = /opt/odoo/odoo-server/addons,/opt/odoo/enterprise/addons,/opt/odoo/custom-addons
10
logfile = /var/log/odoo/odoo-server.log
11
12
workers = 4 ; tune per CPU and RAM
13
max_cron_threads = 1
14
limit_memory_soft = 2147483648 ; 2GB, tune based on RAM
15
limit_time_cpu = 60
16
limit_time_real = 120
17
db_maxconn = 64

Set workers to 0 for testing; for production set workers = (CPU * 2) + 1 as a baseline and tune.

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

1
sudo mkdir -p /opt/odoo/custom-addons
2
sudo chown odoo:odoo /opt/odoo/custom-addons
3
4
sudo mkdir -p /var/log/odoo
5
sudo chown odoo:odoo /var/log/odoo
6
7
sudo chown odoo: /etc/odoo-server.conf
8
sudo chmod 640 /etc/odoo-server.conf
  1. Create a Systemd Service File
1
sudo nano /etc/init.d/odoo-server

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

Add the following content to the file:

1
#!/bin/sh
2
### BEGIN INIT INFO
3
# Provides: odoo-server
4
# Required-Start: $remote_fs $syslog
5
# Required-Stop: $remote_fs $syslog
6
# Should-Start: $network
7
# Should-Stop: $network
8
# Default-Start: 2 3 4 5
9
# Default-Stop: 0 1 6
10
# Short-Description: Enterprise Business Applications
11
# Description: ODOO Business Applications
12
### END INIT INFO
13
14
15
PATH=/opt/odoo/venv/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
16
DAEMON=/opt/odoo/odoo-server/odoo-bin
17
VENV=/odoo/venv/bin/python3
18
NAME=odoo-server
19
DESC=odoo-server
20
21
# Specify the user under which the Odoo service will run
22
USER=odoo
23
24
# Path to the Odoo configuration file
25
CONFIGFILE="/etc/odoo-server.conf"
26
27
# PID file location
28
PIDFILE=/var/run/${NAME}.pid
29
30
# Additional options that are passed to the Daemon
31
DAEMON_OPTS="-c $CONFIGFILE"
32
33
# Check if the DAEMON executable exists and CONFIGFILE is present
34
[ -x $DAEMON ] || { echo "DAEMON not found"; exit 1; }
35
[ -f $CONFIGFILE ] || { echo "CONFIGFILE not found"; exit 1; }
36
37
# Function to check if the PID file exists and if the process is running
38
checkpid() {
39
[ -f $PIDFILE ] || return 1
40
pid=$(cat $PIDFILE)
41
[ -d /proc/$pid ] && return 0
42
return 1
43
}
44
45
case "${1}" in
46
start)
47
echo -n "Starting ${DESC}: "
48
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER --background --make-pidfile --exec $VENV $DAEMON -- $DAEMON_OPTS
49
echo "${NAME} started."
50
;;
51
stop)
52
echo -n "Stopping ${DESC}: "
53
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo
54
echo "${NAME} stopped."
55
;;
56
restart|force-reload)
57
echo -n "Restarting ${DESC}: "
58
start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo
59
sleep 5
60
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER --background --make-pidfile --exec $VENV $DAEMON -- $DAEMON_OPTS
61
echo "${NAME} restarted."
62
;;
63
status)
64
if checkpid; then
65
echo "${DESC} is running."
66
else
67
echo "${DESC} is not running."
68
fi
69
;;
70
*)
71
echo "Usage: $NAME {start|stop|restart|force-reload|status}" >&2
72
exit 1
73
;;
74
esac
75
exit 0

or you can copy the it from the Odoo source (/opt/odoo/odoo-server/debian/init). make sure to update the paths according to your environment.

1
sudo chmod 755 /etc/init.d/odoo-server
2
sudo chown root: /etc/init.d/odoo-server
3
4
sudo update-rc.d odoo-server defaults
  1. Start Odoo Service
1
sudo su root -c "/etc/init.d/odoo-server start"

at this point your odoo service will start and you will be able to access it from your IP address like http://your_server_ip:8069

Now we need to add the nginx reverse proxy to access Odoo from domain. make sure you have a domain/subdomain ready and DNS A record pointed to the server IP address.

  1. Nginx reverse proxy & HTTPS (Let’s Encrypt)
  • Create an Nginx site that reverse proxies and forwards WebSocket/longpoll requests for chat / live features (if you use longpolling or an external bus).
  • Use Certbot to obtain certificates:
1
sudo apt install -y nginx
2
3
sudo apt-get install -y snapd
4
sudo snap install core; snap refresh core
5
sudo snap install --classic certbot
6
sudo ln -s /snap/bin/certbot /usr/bin/certbot

create the nginx configuration file

1
sudo nano /etc/nginx/sites-available/odoo.conf

paste the below content (make sure to change the domain name)

1
#odoo server
2
upstream odoo_server {
3
server 127.0.0.1:8069;
4
}
5
upstream odoo_server_chat {
6
server 127.0.0.1:8072;
7
}
8
9
map $http_upgrade $connection_upgrade {
10
default upgrade;
11
'' close;
12
}
13
14
server {
15
16
listen 80;
17
server_name yourdmoain.com www.yourdmoain.com;
18
proxy_read_timeout 900s;
19
proxy_connect_timeout 900s;
20
proxy_send_timeout 900s;
21
add_header X-Frame-Options "SAMEORIGIN";
22
add_header X-XSS-Protection "1; mode=block";
23
proxy_set_header X-Client-IP $remote_addr;
24
proxy_set_header HTTP_X_FORWARDED_HOST $remote_addr;
25
26
# Add Headers for odoo proxy mode
27
proxy_set_header Host $host;
28
proxy_set_header X-Forwarded-Host $host;
29
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
30
proxy_set_header X-Forwarded-Proto $scheme;
31
proxy_set_header X-Real-IP $remote_addr;
32
underscores_in_headers on;
33
34
# increase proxy buffer size
35
proxy_buffers 16 64k;
36
proxy_buffer_size 128k;
37
38
# force timeouts if the backend dies
39
proxy_next_upstream error timeout invalid_header http_500 http_502
40
http_503;
41
42
types {
43
text/less less;
44
text/scss scss;
45
}
46
47
# log
48
access_log /var/log/nginx/odoo_access.log;
49
error_log /var/log/nginx/odoo_error.log;
50
51
# Redirect longpoll requests to odoo longpolling port
52
location /longpolling {
53
proxy_pass http://odoo_server_chat;
54
}
55
56
# Redirect requests to odoo backend server
57
location / {
58
proxy_redirect off;
59
proxy_pass http://odoo_server;
60
}
61
62
location /websocket {
63
proxy_set_header Upgrade $http_upgrade;
64
proxy_set_header Connection $connection_upgrade;
65
proxy_set_header X-Forwarded-Host $host;
66
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
67
proxy_set_header X-Forwarded-Proto $scheme;
68
proxy_set_header X-Real-IP $remote_addr;
69
proxy_pass http://odoo_server_chat;
70
}
71
72
# enable data compression
73
gzip on;
74
gzip_min_length 1100;
75
gzip_buffers 4 32k;
76
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript application/pdf image/jpeg image/png;
77
gzip_vary on;
78
client_header_buffer_size 4k;
79
large_client_header_buffers 4 64k;
80
client_max_body_size 0;
81
82
}

save and exit the file. now we need to create the symbolic link to the odoo reverse proxy file. and check the configuration

1
ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/sites-enabled/odoo.conf
2
nginx -t

now we will acquire the ssl certificate using the certbot. (make sure to change the domain name)

1
sudo certbot --nginx -d yourdmoain.com www.yourdmoain.com

at this point you should access the odoo from your configured domain. open your domain on the browser and you should see the odoo database selector initially.

Additional checklist

  • Enable a firewall (UFW): Allow only essential ports — SSH (preferably on a custom port), HTTP (80), and HTTPS (443).
  • Restrict database access: Disable remote PostgreSQL connections unless absolutely required. Bind PostgreSQL to localhost or limit access within your private network (VPC).
  • Keep the system updated: Regularly apply OS and package updates to patch vulnerabilities and maintain stability.
  • Rotate and manage logs: Set up log rotation for Odoo logs to prevent large file sizes from consuming disk space. Use logrotate or systemd journaling rules.
  • Automate database backups: Schedule daily automated backups of both the PostgreSQL database and filestore. Test restores periodically to ensure data integrity.
  • Optimize PostgreSQL for Odoo: Tune key parameters like shared_buffers, work_mem, and effective_cache_size based on available RAM. Monitor performance regularly and adjust as workload grows.

While this guide gives you a strong foundation for self-hosting Odoo, building a fully optimized business management system takes deeper expertise. For professional Odoo implementation, custom module development, smooth data migration, and reliable deployment, partner with a team that knows Odoo inside out.
Contact Heliconia Solutions to turn your Odoo instance into a powerful, tailored platform that truly fits your business.

Read Next