On this page
- How much server does an Odoo install want?
- How do you install PostgreSQL and the Odoo package?
- Which settings belong in odoo.conf?
- How do you set up Nginx so chat and notifications work?
- How should the firewall be configured?
- How do you create the first database and lock the manager?
- How does Odoo send email through a relay?
- How do you back up and upgrade Odoo safely?
- What fixes the usual Odoo problems?
- Questions
How much server does an Odoo install want?
A small company database with a handful of users runs comfortably on 2 vCPU and 4 GB of memory; each Odoo worker process takes roughly 150 to 300 MB once modules are loaded. Odoo 19 supports Ubuntu 24.04 and Debian 12 or 13 through its packages, and the package pulls in the Python libraries it needs from the distribution.
- A sudo user such as
deploy(see creating a sudo user). - A hostname like
erp.example.netwith A and AAAA records for198.51.100.24and2001:db8:4f2a::24, set up as in DNS records. - A swap file on 2 GB plans, because module upgrades briefly use a lot of memory (swap file guide).
Odoo Community is free and open source; the Enterprise edition needs a subscription and is installed differently, so this page covers Community only.
How do you install PostgreSQL and the Odoo package?
Odoo stores everything in PostgreSQL, so install the database server first, then add the signed Odoo repository and install the package. Replace 19.0 with a newer series when one is released.
sudo apt update
sudo apt install -y postgresql gnupg curl
curl -fsSL 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/19.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list
sudo apt update
apt policy odoo
sudo apt install -y odooThe package creates a system user and a matching PostgreSQL role called odoo, writes /etc/odoo/odoo.conf and starts the odoo service on port 8069. Confirm what you got:
odoo --version
systemctl status odoo --no-pager
sudo ss -tlnp | grep -E '8069|8072'For PDF reports Odoo calls wkhtmltopdf. The distribution package (sudo apt install wkhtmltopdf) prints invoices fine, though headers and footers render best with the patched Qt build that the wkhtmltopdf project publishes as a .deb.
Which settings belong in odoo.conf?
Five settings matter for a server behind a proxy: the master password, the listen address, proxy mode, workers and the WebSocket (gevent) port. Open the file with sudo nano /etc/odoo/odoo.conf and make the [options] block look like this:
[options]
admin_passwd = REPLACE_WITH_A_LONG_RANDOM_STRING
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /usr/lib/python3/dist-packages/odoo/addons
http_interface = 127.0.0.1
proxy_mode = True
workers = 3
max_cron_threads = 1
gevent_port = 8072
limit_memory_soft = 671088640
limit_memory_hard = 1073741824
logfile = /var/log/odoo/odoo-server.logGenerate the master password with openssl rand -base64 24. A common sizing rule is two workers per vCPU plus one, trimmed down if memory is tight. With workers above zero, Odoo runs the live bus on gevent_port, which Nginx has to route separately. Apply the change:
sudo systemctl restart odoo
sudo ss -tlnp | grep -E '8069|8072'
curl -sI http://127.0.0.1:8069/web/login | head -n 1Both ports should now listen on 127.0.0.1 only, and the last command should answer with an HTTP 200 or a redirect.
How do you set up Nginx so chat and notifications work?
Send ordinary requests to 8069 and the /websocket path to 8072 with upgrade headers; without that split, Discuss messages and live form updates stall. Install Nginx and create /etc/nginx/sites-available/odoo:
sudo apt install -y nginx certbot python3-certbot-nginxupstream odoo_http { server 127.0.0.1:8069; }
upstream odoo_ws { server 127.0.0.1:8072; }
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name erp.example.net;
client_max_body_size 64M;
proxy_read_timeout 720s;
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 /websocket {
proxy_pass http://odoo_ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location / {
proxy_pass http://odoo_http;
proxy_redirect off;
}
gzip on;
gzip_types text/css text/plain application/json application/javascript;
}sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d erp.example.netCertbot adds the 443 listener and the HTTP redirect; renewals run on a systemd timer, as explained in the Certbot guide. Caddy is a shorter alternative: a site block with reverse_proxy /websocket 127.0.0.1:8072 followed by reverse_proxy 127.0.0.1:8069 does the same job (see Caddy HTTPS).
How should the firewall be configured?
Let only SSH and web traffic in; Odoo and PostgreSQL stay reachable from the machine itself.
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
sudo ufw status numberedPostgreSQL on Debian and Ubuntu listens on localhost by default, so there is nothing to close there. The ufw guide covers rate limiting SSH if you want an extra layer.
How do you create the first database and lock the manager?
Open https://erp.example.net/web/database/manager, enter the master password from odoo.conf, and create a database with your company name, admin email, language and country. Tick the demo data box only on a test copy. After the database exists, hide the manager from the public:
sudo nano /etc/odoo/odoo.conf
# add these two lines
list_db = False
dbfilter = ^erp$
sudo systemctl restart odooReplace erp with the name you chose. With the list hidden, visitors go straight to the login page and nobody can try the master password from a browser. Install apps such as Invoicing, Sales, Inventory or CRM from the Apps menu afterwards; each one runs a database update that can take a minute.
How does Odoo send email through a relay?
Add an outgoing mail server under Settings, Technical, Outgoing Mail Servers (turn on developer mode first) and point it at an authenticated SMTP relay on port 587 with STARTTLS. That route works without any special network setup. Outbound port 25 may not be open on a new server, so open a support ticket and ask before planning to deliver mail directly; the relay is the dependable choice either way, and SMTP relay for apps lists the DNS records (SPF, DKIM) that keep invoices out of spam folders. Use the Test Connection button, then send a quotation to yourself.
How do you back up and upgrade Odoo safely?
Back up two things together: the PostgreSQL database and the filestore under /var/lib/odoo/.local/share/Odoo/filestore/. A nightly job could look like this:
sudo -u odoo pg_dump -Fc erp > /var/backups/erp-$(date +%F).dump
sudo tar czf /var/backups/erp-filestore-$(date +%F).tgz -C /var/lib/odoo/.local/share/Odoo/filestore erpMinor updates inside one series arrive through sudo apt update && sudo apt upgrade; after one, run sudo -u odoo odoo -c /etc/odoo/odoo.conf -d erp -u all --stop-after-init to refresh module data. Jumping a major series (18 to 19) needs a database migration, which the Community edition does not do automatically, so test it on a copy first. For whole-disk protection add daily backups to the server.
What fixes the usual Odoo problems?
- Bus or chat shows a connection warning: the
/websocketlocation is missing or points at 8069. Check withsudo ss -tlnp | grep 8072. - Workers get killed during imports: raise
limit_memory_hardor reduceworkers; the log at/var/log/odoo/odoo-server.lognames the cause. - Links point to http:
proxy_modeis off or Nginx is not sendingX-Forwarded-Proto. Also set the system parameterweb.base.urlto the HTTPS address. - Server runs out of memory: move to a bigger plan as shown in moving to a larger plan.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Odoo ERP on Ubuntu or Debian
Is Odoo Community free for commercial use?
Yes. Odoo Community is released under the LGPLv3 license, so a business can run it at no license cost. Some apps exist only in the paid Enterprise edition.
Can I use Docker instead of the apt package?
Yes. The official odoo image on Docker Hub works with a postgres container; the proxy and configuration advice on this page stays the same. Our Docker app image gives you the engine preinstalled.
Which port does the Odoo WebSocket use?
With workers enabled, the live bus listens on gevent_port, 8072 by default. Without workers everything runs on 8069, which is fine for testing but not for real use.
How many users can a 4 GB server handle?
It depends on installed apps and usage, so there is no fixed number. Start with three workers, watch memory with free -h and the usage graphs, and scale when it gets tight.
Where do attachments and product images live?
In the filestore at /var/lib/odoo/.local/share/Odoo/filestore/<database>. A database dump without that folder restores records but not files.
More in Self-hosted apps
- Nextcloud on Nginx
- ownCloud Infinite Scale
- Seafile file sync
- Vaultwarden password vault
- Passbolt team password manager
- Gitea Git hosting
- Forgejo Git server
- GitLab Community Edition
- Gogs Git service
- Wiki.js
- BookStack documentation
- Outline knowledge base
- Paperless-ngx documents
- n8n workflow automation
- Activepieces automation
- Plausible Analytics (Community Edition)
- Umami analytics
- Mattermost team chat
- Matrix Synapse with Element
- Jitsi Meet video calls
- ONLYOFFICE Docs with Nextcloud
- HashiCorp Vault secrets server
- OpenBao secrets management
- Infisical secrets manager
- Authelia SSO and forward auth
- Zitadel identity platform
- VS Code in the browser (code-server)
- Joplin Server for notes sync
- Firefly III personal finance
- Snipe-IT asset tracking
- ERPNext with frappe_docker
- Dolibarr ERP and CRM with Nginx
- Penpot design tool with Docker
- Planka kanban boards
- Leantime project management
- Wekan boards with Docker
- Cal.com scheduling
- Chatwoot support inbox
- Mautic marketing automation
- DocuSeal document signing
- Metabase dashboards
- Appwrite backend server
- Self-hosted Supabase
- PocketBase backend
- RustDesk relay server
- Traccar GPS tracking
- Redmine project tracker
- The Lounge IRC client
- CyberChef data toolbox
- Typebot chat forms
- AFFiNE workspace
- Overleaf Community Edition
- Neko shared virtual browser
- imgproxy image resizing
- NetBox network inventory
- UVdesk help desk
- YetiForce CRM