All Articles
Odoo Hosting & Performance

How to Install Odoo on a VPS: Complete Ubuntu Guide for Odoo

August 15, 202615 min read

Learn how to install Odoo on a VPS with Ubuntu, PostgreSQL, Nginx and SSL. Follow this step-by-step guide for Odoo, including configuration, security, backups and production deployment.

Odoo How to Install on VPS: Complete Ubuntu Installation Guide

If you are searching for “Odoo how to install on VPS?”, this guide shows how to deploy Odoo on an Ubuntu VPS using real Linux commands.

This approach is suitable for business owners, CTOs, IT managers and finance managers in Germany, Europe, the USA and international companies that want control over their Odoo infrastructure.

The same architecture can be adapted for Odoo 17, Odoo 18 , Odoo 19 and Odoo 20.

Example environment: Ubuntu 24.04 LTS, Odoo 19 Community, PostgreSQL, Nginx and Let's Encrypt SSL.

Odoo requires PostgreSQL, and Odoo 19 supports PostgreSQL 13 or newer.

VPS Requirements

For a small production installation, consider at least:

  • Ubuntu 24.04 LTS
  • 2+ CPU cores
  • 4 GB+ RAM
  • 50+ GB SSD
  • Public IPv4 address
  • Domain name
  • Root/sudo access

Connect to your VPS:

ssh ubuntu@YOUR_SERVER_IP

Replace YOUR_SERVER_IP with your actual VPS IP address.

Step 1: Update Ubuntu

Run all commands as the standard ubuntu user with sudo.

sudo apt update
sudo apt upgrade -y

sudo apt install -y git wget curl nano unzip \
python3 python3-pip python3-dev python3-venv \
build-essential libxml2-dev libxslt1-dev \
libldap2-dev libsasl2-dev libjpeg-dev \
libpq-dev libffi-dev libssl-dev \
libtiff-dev libopenjp2-7-dev \
libfreetype6-dev liblcms2-dev \
libwebp-dev zlib1g-dev

Check the operating system:

lsb_release -a

Check Python:

python3 --version

Step 2: Install PostgreSQL

Odoo uses PostgreSQL as its database system.

sudo apt install -y postgresql postgresql-client

Enable PostgreSQL:

sudo systemctl enable postgresql
sudo systemctl start postgresql

Check its status:

sudo systemctl status postgresql

Create an Odoo PostgreSQL user:

sudo -u postgres createuser -s odoo

Verify:

sudo -u postgres psql -c "\du"

Step 3: Create the Odoo Linux User

Although you connect to the VPS as ubuntu, Odoo should run under its own Linux service account.

sudo adduser --system --home=/opt/odoo --group odoo

Create required directories:

sudo mkdir -p /opt/odoo
sudo mkdir -p /opt/odoo/custom-addons
sudo mkdir -p /var/log/odoo
sudo mkdir -p /var/lib/odoo

Set ownership:

sudo chown -R odoo:odoo /opt/odoo
sudo chown -R odoo:odoo /var/log/odoo
sudo chown -R odoo:odoo /var/lib/odoo

Step 4: Download Odoo

For a source installation, clone the required Odoo branch.

For Odoo 20:

sudo -u odoo git clone --depth 1 --branch 20.0 https://github.com/odoo/odoo.git /opt/odoo/odoo

For Odoo 19:

sudo -u odoo git clone --depth 1 --branch 19.0 https://github.com/odoo/odoo.git /opt/odoo/odoo

For Odoo 18:

sudo -u odoo git clone --depth 1 --branch 18.0 https://github.com/odoo/odoo.git /opt/odoo/odoo

For Odoo 17:

sudo -u odoo git clone --depth 1 --branch 17.0 https://github.com/odoo/odoo.git /opt/odoo/odoo

Check the installation:

ls -la /opt/odoo/odoo

Step 5: Create Python Virtual Environment

For Odoo 19:

sudo -u odoo python3 -m venv /opt/odoo/venv

Activate it:

sudo -u odoo /opt/odoo/venv/bin/pip install --upgrade pip setuptools wheel

Install Odoo requirements:

sudo -u odoo /opt/odoo/venv/bin/pip install -r /opt/odoo/odoo/requirements.txt

Odoo's source-install documentation describes using the Odoo source together with its Python dependencies and PostgreSQL.

Step 6: Create the Odoo Configuration File

Create:

sudo nano /etc/odoo.conf

Use this sample production configuration:

[options]

; PostgreSQL
db_host = False
db_port = False
db_user = odoo
db_password = False

; Odoo paths
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addons

; Network
http_port = 8069

; Security
admin_passwd = CHANGE_THIS_TO_A_LONG_RANDOM_PASSWORD

; Logging
logfile = /var/log/odoo/odoo.log
log_level = info

; Performance
limit_time_cpu = 600
limit_time_real = 1200
limit_request = 8192

; Workers
workers = 2

; Proxy
proxy_mode = True

; Data directory
data_dir = /var/lib/odoo

Generate a strong password:

openssl rand -base64 32

Copy the generated value into:

admin_passwd = YOUR_GENERATED_PASSWORD

Protect the configuration:

sudo chown odoo:odoo /etc/odoo.conf
sudo chmod 640 /etc/odoo.conf

Step 7: Test Odoo Manually

Before creating the system service, test Odoo:

sudo -u odoo /opt/odoo/venv/bin/python \
/opt/odoo/odoo/odoo-bin \
-c /etc/odoo.conf

If Odoo starts successfully, open:

http://YOUR_SERVER_IP:8069

Stop the test server with:

CTRL+C

Step 8: Create a Systemd Service

Create:

sudo nano /etc/systemd/system/odoo.service

Paste:

[Unit]
Description=Odoo
Requires=postgresql.service
After=network.target postgresql.service

[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/venv/bin/python /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Reload systemd:

sudo systemctl daemon-reload

Enable Odoo:

sudo systemctl enable odoo

Start Odoo:

sudo systemctl start odoo

Check:

sudo systemctl status odoo

View live logs:

sudo journalctl -u odoo -f

View Odoo's log:

sudo tail -f /var/log/odoo/odoo.log

Restart:

sudo systemctl restart odoo

Stop:

sudo systemctl stop odoo

Step 9: Configure Firewall

Install UFW:

sudo apt install -y ufw

Allow SSH:

sudo ufw allow OpenSSH

Allow HTTP and HTTPS:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Enable firewall:

sudo ufw enable

Check:

sudo ufw status

Do not expose port 8069 publicly once Nginx is configured.

Step 10: Install Nginx

sudo apt install -y nginx

Enable it:

sudo systemctl enable nginx
sudo systemctl start nginx

Create your website configuration:

sudo nano /etc/nginx/sites-available/odoo

Example:

server {
    listen 80;
    server_name odoo.example.com;

    proxy_read_timeout 720s;
    proxy_connect_timeout 720s;
    proxy_send_timeout 720s;

    location / {
        proxy_pass http://127.0.0.1:8069;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /longpolling {
        proxy_pass http://127.0.0.1:8072;
    }
}

Replace:

odoo.example.com

with your real domain.

Enable the configuration:

sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo

Test Nginx:

sudo nginx -t

Restart:

sudo systemctl restart nginx

Step 11: Install SSL

Install Certbot:

sudo apt install -y certbot python3-certbot-nginx

Request SSL:

sudo certbot --nginx -d odoo.example.com

Test renewal:

sudo certbot renew --dry-run

Your Odoo URL should now be:

https://odoo.example.com

Step 12: Create Your First Database

Open your domain:

https://odoo.example.com

Enter the database master password from:

admin_passwd = YOUR_GENERATED_PASSWORD

Then create your Odoo database.

Step 13: Install Custom Addons

Copy your custom module:

sudo cp -R my_module /opt/odoo/custom-addons/

Set ownership:

sudo chown -R odoo:odoo /opt/odoo/custom-addons

Restart Odoo:

sudo systemctl restart odoo

Update the Apps list from Odoo and install the module.

Step 14: Backup Odoo

Create a backup directory:

sudo mkdir -p /opt/odoo/backups
sudo chown odoo:odoo /opt/odoo/backups

Example PostgreSQL backup:

sudo -u postgres pg_dump DATABASE_NAME | gzip > /opt/odoo/backups/DATABASE_NAME_$(date +%F).sql.gz

Check backups:

ls -lh /opt/odoo/backups/

Also back up the Odoo filestore:

sudo tar -czf /opt/odoo/backups/filestore_$(date +%F).tar.gz /var/lib/odoo/filestore

Important: production backups should also be copied to separate storage. A backup stored on the same VPS does not protect you from complete VPS failure.

Step 15: Useful Odoo VPS Commands

Check Odoo:

sudo systemctl status odoo

Restart Odoo:

sudo systemctl restart odoo

View Odoo logs:

sudo tail -100 /var/log/odoo/odoo.log

Follow logs:

sudo tail -f /var/log/odoo/odoo.log

Check PostgreSQL:

sudo systemctl status postgresql

Check Nginx:

sudo systemctl status nginx

Test Nginx:

sudo nginx -t

Check disk:

df -h

Check RAM:

free -h

Check CPU/processes:

htop

Install htop if required:

sudo apt install -y htop

Check listening ports:

sudo ss -lntp

Check Odoo port:

sudo ss -lntp | grep 8069

Check Ubuntu version:

lsb_release -a

Reboot the VPS:

sudo reboot

Odoo 17, 18, 19 and 20 VPS Implementations

The exact Python dependencies and supported operating-system requirements vary by Odoo version, so production deployments should be version-specific rather than blindly copying an Odoo 19 installation to Odoo 17 or 18.

My Odoo implementation experience includes Odoo 17, Odoo 18 , Odoo 19 and Odoo 20, including successful implementations such as HighmoonRentals and Rheintal Arhmaten, with environments of approximately 5 customers/users.

For businesses migrating to Odoo, the VPS is only one part of the project. The more important work is configuring accounting, inventory, sales, purchasing, CRM, integrations, security, migration and reporting correctly.

Should You Install Odoo Yourself?

Yes, if you are comfortable with Linux, PostgreSQL, Nginx, systemd, networking and server security.

For a production business environment, however, professional Odoo deployment can help avoid problems with:

  • Database configuration
  • SSL and DNS
  • Nginx
  • PostgreSQL
  • Backups
  • Custom modules
  • Odoo upgrades
  • Performance
  • Security
  • Data migration
  • GDPR requirements
  • German accounting requirements

If your company is in Germany, Europe or the USA and you need Odoo implementation, migration, VPS deployment, customization or integrations, I can help.

Visit ShahidMalik.io to discuss your Odoo project.

Shahid Malik provides Odoo consulting, implementation, migration, Odoo AI and integration, Ecommerce, Support and maintenance services and Automation and Process Optimization for Germany, Europe, the USA and international businesses.

Frequently Asked Questions

Can I install Odoo on a VPS using the Ubuntu user? Yes. You can connect through SSH as ubuntu and use sudo. For security, Odoo itself should run under a dedicated odoo Linux service account.

Which Ubuntu version should I use for Odoo 19? Odoo's current documentation states that its Odoo 19 Debian package supports Ubuntu 24.04 LTS.

Can I run Odoo 17, 18, 19 and 20 on one VPS? Yes, but each version should have isolated directories, Python environments, configuration files, PostgreSQL databases and ports. Source installation is particularly useful when multiple Odoo versions need to coexist.

Does Odoo require PostgreSQL? Yes. PostgreSQL is Odoo's database management system. Odoo 19 requires PostgreSQL 13 or newer for source installations.

Is Odoo VPS installation enough for a production ERP? No. Production deployment should also address SSL, Nginx, backups, monitoring, security, PostgreSQL, email delivery, custom modules and disaster recovery.

Whether you are designing a complex custom application, refactoring legacy modules, or planning a major Odoo upgrade in Germany, Europe, or internationally, proper architecture makes all the difference. 👉 Book an Odoo Migration Consultation with Shahid Malik

Or Hire me directly

👉 Hire shahid directly

Related Reading

Shahid Malik - AI-First Odoo Consultant

Shahid Malik

AI-First Odoo ERP Specialist

Shahid Malik is an AI-first Odoo consultant helping businesses solve complex ERP and business process challenges. His work combines Odoo consulting, process optimization, automation, integrations, migrations, and practical AI solutions to build scalable and reliable business systems.

Book a consultation for your Odoo project