Server Administration
Hosting Odoo 17 on a VPS: Requirements, Install Outline and Backups
By NileVPS Team · Published · 4 min read
اقرأ المقال بالعربيOdoo is a popular open-source business suite covering accounting, inventory, sales, CRM, point of sale and much more. Running it on your own VPS gives you full control over modules, custom code, data location and upgrade timing. It also means you are responsible for keeping it fast, secure and backed up. This guide covers what Odoo 17 needs, an install outline on Ubuntu, putting Nginx in front with HTTPS, and a backup routine you can trust. It focuses on the Community edition installed from source, which is the most transparent way to learn how the pieces fit together.
What Odoo 17 needs
Software
- Operating system: Ubuntu 22.04 LTS or Debian 12 are common, well-documented choices.
- Python: 3.10 or newer.
- PostgreSQL: version 12 or newer. The version in your distribution's repositories is usually fine.
- wkhtmltopdf: used to print PDF reports. Odoo recommends version 0.12.6 with patched Qt; the plain package from some repositories produces reports without headers and footers.
- Node.js tools only if you need right-to-left CSS support:
rtlcss, which matters for Arabic interfaces.
Server size
Odoo's needs depend on the number of concurrent users, installed apps and custom modules. As rough starting points:
| Use | Starting point |
|---|---|
| Testing or a very small team | 2 vCPU, 4 GB RAM |
| Small business, light daily use | 4 vCPU, 8 GB RAM |
| Larger team, POS, heavy reports | 8 vCPU, 16 GB RAM or more |
Fast NVMe storage helps PostgreSQL noticeably. Start sensibly, monitor, and resize when needed; you can compare plans on the pricing page. Take a snapshot before every major change so you can roll back quickly.
Install outline on Ubuntu 22.04
The steps below are an outline, not a copy-paste script. Read each one and adapt names and passwords.
1. System packages and PostgreSQL
sudo apt update && sudo apt upgrade -y
sudo apt install -y git python3-pip python3-dev python3-venv build-essential \
libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libpq-dev \
libjpeg-dev zlib1g-dev postgresql nginx2. A dedicated system user and database role
sudo adduser --system --group --home /opt/odoo17 odoo17
sudo -u postgres createuser --createdb odoo17Odoo should never run as root, and the database role should not be a PostgreSQL superuser.
3. Odoo source and Python environment
sudo -u odoo17 git clone --depth 1 --branch 17.0 https://github.com/odoo/odoo.git /opt/odoo17/odoo
sudo -u odoo17 python3 -m venv /opt/odoo17/venv
sudo -u odoo17 /opt/odoo17/venv/bin/pip install wheel
sudo -u odoo17 /opt/odoo17/venv/bin/pip install -r /opt/odoo17/odoo/requirements.txt
sudo -u odoo17 mkdir -p /opt/odoo17/custom-addonsInstall wkhtmltopdf 0.12.6 with patched Qt from the project's official release packages for your distribution.
4. Configuration file
Create /etc/odoo17.conf:
[options]
admin_passwd = a-long-random-master-password
db_user = odoo17
db_host = False
addons_path = /opt/odoo17/odoo/addons,/opt/odoo17/custom-addons
data_dir = /opt/odoo17/.local/share/Odoo
http_interface = 127.0.0.1
proxy_mode = True
list_db = False
workers = 5
max_cron_threads = 1
logfile = /var/log/odoo17/odoo.logNotes on the important lines:
workersenables multi-process mode. Odoo's documentation suggests roughly(CPU cores x 2) + 1as an upper bound; with workers enabled, real-time features use the separate gevent port (8072 by default).proxy_mode = Truemakes Odoo trust the headers from Nginx.list_db = Falsehides the database manager from the public. Combined with a strongadmin_passwd, this closes a common attack surface.
Create the log directory with sudo mkdir /var/log/odoo17 && sudo chown odoo17: /var/log/odoo17 and protect the config with sudo chown odoo17: /etc/odoo17.conf && sudo chmod 640 /etc/odoo17.conf.
5. systemd service
/etc/systemd/system/odoo17.service:
[Unit]
Description=Odoo 17
After=network.target postgresql.service
[Service]
User=odoo17
Group=odoo17
ExecStart=/opt/odoo17/venv/bin/python3 /opt/odoo17/odoo/odoo-bin -c /etc/odoo17.conf
Restart=on-failure
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now odoo17
sudo systemctl status odoo17Nginx and HTTPS
upstream odoo { server 127.0.0.1:8069; }
upstream odoochat { server 127.0.0.1:8072; }
server {
server_name erp.example.com;
client_max_body_size 100m;
proxy_read_timeout 720s;
location /websocket {
proxy_pass http://odoochat;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
proxy_pass http://odoo;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
gzip on;
gzip_types text/css application/javascript application/json text/plain;
}Enable it, then run sudo certbot --nginx -d erp.example.com. Allow only SSH, HTTP and HTTPS in the firewall; ports 8069 and 8072 should never be public. For more on hardening, see our cloud server security best practices.
Backups that actually restore
An Odoo backup has two parts, and you need both:
- The PostgreSQL database, which holds all records.
- The filestore, which holds attachments and images:
<data_dir>/filestore/<database_name>.
A simple nightly script:
#!/bin/bash
set -euo pipefail
DB=mycompany
DEST=/var/backups/odoo/$(date +%F)
mkdir -p "$DEST"
sudo -u odoo17 pg_dump -Fc "$DB" > "$DEST/$DB.dump"
tar -czf "$DEST/filestore.tar.gz" -C /opt/odoo17/.local/share/Odoo/filestore "$DB"
find /var/backups/odoo -maxdepth 1 -type d -mtime +14 -exec rm -rf {} +Schedule it with cron, copy the results to storage outside the server, and test a restore on a separate VPS regularly: pg_restore -d newdb file.dump plus extracting the filestore under the new database name.
FAQ
Can I install Odoo with Docker instead?
Yes. Official Odoo images exist and work well with a PostgreSQL container and Nginx in front. The same rules apply: persist the filestore and database volumes, and back up both.
Is Odoo Community free to host?
Odoo Community is open source under the LGPLv3 license, so you can host it on your own server without a license fee. Odoo Enterprise requires a paid subscription from Odoo.
How do I upgrade Odoo safely?
Minor updates within 17.0 are a git pull, a module update and a service restart, done after a snapshot. Moving to a new major version requires a database migration, so test it on a copy first.