bolt Valebyte VPS from $4/mo — NVMe, 60s deploy.

Get a VPS arrow_forward
eco Beginner Tutorial/How-to

Install Odoo on VPS

calendar_month Jul 19, 2026 schedule 21 min read visibility 26 views
info

Need a server for this guide? We offer dedicated servers and VPS in 50+ countries with instant setup.

Need a server for this guide?

Deploy a VPS or dedicated server in minutes.

Installing Odoo on VPS: PostgreSQL, Nginx, Let's Encrypt, and Automatic Backups

TL;DR

In this detailed guide, we will step-by-step configure Odoo — a powerful Enterprise Resource Planning (ERP) system — on your own VPS server. You will learn how to install and configure PostgreSQL for data storage, Nginx as a high-performance reverse proxy, secure the connection with Let's Encrypt SSL certificates, and set up automatic backups to protect your data.

  • Complete installation of Odoo 17/18 on Ubuntu 24.04 LTS.
  • PostgreSQL 16 configuration for optimal Odoo performance.
  • Nginx 1.26 setup as a reverse proxy with WebSocket support.
  • Automatic acquisition and renewal of Let's Encrypt SSL certificates via Certbot.
  • Creation of a script for automatic backup of Odoo database and files.
  • Basic server protection using UFW and Fail2ban.

What We Are Setting Up and Why

Odoo is comprehensive business management software offering a wide range of integrated applications such as CRM, sales, e-commerce, accounting, warehouse management, project management, and much more. It is a powerful tool for companies of any size striving to optimize their business processes and increase efficiency.

Within this guide, we will deploy the current version of Odoo (presumably Odoo 17 or 18, current for 2026) on the Ubuntu 24.04 LTS operating system. We will configure PostgreSQL as the primary database, Nginx as a high-performance web server and reverse proxy for Odoo, and integrate Let's Encrypt for free SSL certificates, ensuring a secure HTTPS connection. The ultimate goal is to achieve a fully functional, secure, and easily maintainable Odoo installation, accessible via a domain name with encrypted traffic.

The reader will ultimately receive a fully configured Odoo server, ready for deploying business processes. This will not just be an installation, but a complete infrastructure considering security, performance, and data recovery capabilities.

Alternatives exist, such as cloud-managed Odoo solutions (Odoo Online, Odoo.sh) or third-party hosting providers offering Odoo as a service. However, self-deployment on your own VPS provides several significant advantages:

  • Full Control: You have complete control over the server environment; you can install any modules, configure performance and security settings as you wish.
  • Cost Savings: For large data volumes or a large number of users, a self-hosted solution often turns out to be significantly cheaper in the long run compared to a monthly subscription to cloud services.
  • Flexibility: The ability to integrate with your other systems, install specific extensions, and perform deep customization without provider restrictions.
  • Data Security: Your data is stored on your server, which can be critically important for companies with strict privacy and data sovereignty requirements.

Choosing self-hosted Odoo on a VPS is ideal for those seeking maximum flexibility, data control, and cost optimization, while being willing to take responsibility for server administration.

What VPS Configuration is Needed for This Task

VPS requirements for Odoo can vary greatly depending on the number of users, data volume, number of installed modules, and intensity of use. However, for getting started and small companies, the following minimum and recommended requirements can be highlighted:

Minimum requirements for Odoo (1-5 users, basic modules):

  • CPU: 1-2 vCPU (e.g., Intel Xeon E5 or equivalent).
  • RAM: 2 GB (for Odoo and PostgreSQL).
  • Disk: 40 GB SSD (for OS, PostgreSQL data, and Odoo files). SSD is critical for DB performance.
  • Network: 100 Mbps bandwidth.

Recommended VPS plan for medium use (up to 20-30 users, several active modules):

  • CPU: 4 vCPU (the higher the core frequency, the better).
  • RAM: 8 GB (will ensure comfortable operation with increasing load).
  • Disk: 160-200 GB NVMe SSD (NVMe is significantly faster than SATA SSD and is recommended for active databases).
  • Network: 1 Gbps bandwidth.

For our Odoo installation task, we will focus on a plan that will ensure stable operation for a small or medium team. You can consider a VPS with the specified characteristics, for example, with 4 vCPU, 8 GB RAM, and 160 GB NVMe SSD. This will provide sufficient performance headroom and disk space for most Odoo usage scenarios.

When a dedicated server is needed, not a VPS

A dedicated server becomes necessary when:

  • Very high load: Hundreds of active users, complex and resource-intensive ERP processes, intensive DB operations.
  • Strict performance requirements: The need for guaranteed performance without "noisy neighbors" (as can happen on a VPS).
  • Specific hardware: RAID arrays, GPUs, or other specialized components are required.
  • Large data volume: Petabytes of data requiring huge disk space.
  • Complete isolation: The maximum level of security and isolation that a VPS cannot provide.

For such scenarios, when a VPS is no longer sufficient, it is worth considering a suitable dedicated server.

Location: what it affects

The choice of VPS server location affects several key factors:

  • Latency: The closer the server is to most of your users, the lower the latency and the faster the web application's response. For international teams, choose a central location.
  • Legal compliance: Storing data in a specific jurisdiction may be mandatory due to GDPR, HIPAA, or other local laws.
  • Cost: VPS prices can vary depending on the data center location.
  • Network reliability: Choose data centers with a good reputation and stable network channels.

Always try to place the server as close as possible to your primary audience or team to minimize latency and ensure the best user experience.

Server Preparation

Before proceeding with the Odoo installation, you need to perform basic setup and security for your fresh Ubuntu 24.04 LTS VPS. These steps will ensure the security and stability of your system.

1. System Update

Always start by updating the package list and installing them to the latest version. This ensures that you are running with the most current security fixes and functionality.


sudo apt update && sudo apt upgrade -y

After the update, a reboot may be required, especially if kernel components were updated.


sudo reboot

After rebooting, log in to the server again.

2. Creating a New User with Sudo Privileges

Working as the root user is insecure. Let's create a new user through whom we will connect via SSH and grant them sudo privileges.


sudo adduser odoo_admin

Follow the prompts to set a password and enter user information (you can leave the fields blank).

Now, let's add the odoo_admin user to the sudo group so they can execute commands with elevated privileges.


sudo usermod -aG sudo odoo_admin

Now, exit the current root session and log in as odoo_admin.


exit

3. Configuring SSH Keys (Recommended)

For increased security, it is recommended to use SSH keys instead of passwords. If you haven't generated keys on your local computer yet, do so:


ssh-keygen -t rsa -b 4096

Copy the public key to the server for the new user odoo_admin. Replace ~/.ssh/id_rsa.pub with the path to your public key and your_vps_ip with your VPS's IP address.


ssh-copy-id odoo_admin@your_vps_ip

After successfully copying the key, you can disable password authentication in the /etc/ssh/sshd_config file for the odoo_admin user by setting PasswordAuthentication no and restarting the SSH service.


sudo nano /etc/ssh/sshd_config

Find the line PasswordAuthentication yes and change it to:


PasswordAuthentication no

It is also recommended to change the default SSH port (22) to another one, for example, 2222, to reduce the number of automated attacks.


Port 2222

Save changes (Ctrl+O, Enter, Ctrl+X) and restart the SSH service:


sudo systemctl restart sshd

Now you will be able to connect only via SSH key on the new port: ssh -p 2222 odoo_admin@your_vps_ip.

4. Configuring the Firewall (UFW)

The Uncomplicated Firewall (UFW) is easy to use and allows you to control incoming and outgoing traffic. By default, UFW blocks all incoming connections and allows all outgoing connections.


sudo apt install ufw -y
sudo ufw allow 2222/tcp          # Allow SSH on the new port
sudo ufw allow 80/tcp           # Allow HTTP (for Let's Encrypt)
sudo ufw allow 443/tcp          # Allow HTTPS
sudo ufw enable                 # Enable UFW
sudo ufw status                 # Check UFW status

Confirm UFW activation by entering y.

5. Installing Fail2ban

Fail2ban scans server logs for suspicious activity (e.g., multiple failed SSH login attempts) and automatically blocks attacker IP addresses using firewall rules.


sudo apt install fail2ban -y
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
sudo nano /etc/fail2ban/jail.local

In the jail.local file, find the [sshd] section and ensure it is enabled (enabled = true). If you changed the SSH port, specify it in the port parameter.


[sshd]
enabled = true
port = 2222

Save changes and restart Fail2ban:


sudo systemctl restart fail2ban
sudo fail2ban-client status sshd # Check the status of the sshd service in Fail2ban

Now your server is ready for the installation of Odoo and its related components.

Software Installation — Step-by-Step

In this section, we will install all necessary components: PostgreSQL, Python 3 and its dependencies, Odoo itself, and then Nginx and Certbot.

All commands will be executed as user odoo_admin using sudo, if necessary.

1. Installing PostgreSQL 16

Odoo uses PostgreSQL as its primary database. We will install the current version of PostgreSQL and create a user and database for Odoo.


sudo apt install postgresql postgresql-client -y # Install PostgreSQL 16 (current as of 2026)
sudo systemctl start postgresql                  # Start PostgreSQL service
sudo systemctl enable postgresql                 # Enable PostgreSQL autostart

We will create a system user odoo, who will be the owner of the Odoo database.


sudo su - postgres -c "createuser -s odoo"       # Create PostgreSQL user 'odoo'

Odoo will use this user to access its database. A password is not required for this user, as Odoo will connect locally using peer authentication.

2. Installing Python 3 and its Dependencies

Odoo is written in Python. We will need Python 3, its package manager pip, as well as a number of libraries and dependencies.


sudo apt install python3 python3-pip python3-dev -y # Install Python 3, pip, and dev files
sudo apt install build-essential libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev liblcms2-dev libffi-dev libssl-dev -y # Install system dependencies
sudo apt install npm nodejs -y # Install Node.js and npm for some Odoo modules (e.g., web editor)
sudo npm install -g lessc # Install Less CSS compiler

3. Creating a System User and Directory for Odoo

For security, Odoo should run under a separate system user without root privileges.


sudo adduser --system --home=/opt/odoo --group odoo # Create system user 'odoo'

This user will own the Odoo files and run the service.

4. Downloading and Installing Odoo 17/18

We will use the latest stable version of Odoo, current as of 2026, for example, Odoo 17 or 18. We will download it from the official GitHub repository.


sudo su - odoo -s /bin/bash # Switch to user 'odoo'
git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo17 # Clone Odoo 17 (or 18)
exit # Return to odoo_admin user

We will create a Python virtual environment for Odoo and install all necessary Python dependencies.


sudo python3 -m venv /opt/odoo/odoo17-venv # Create virtual environment
sudo /opt/odoo/odoo17-venv/bin/pip install wheel # Install wheel
sudo /opt/odoo/odoo17-venv/bin/pip install -r /opt/odoo/odoo17/requirements.txt # Install Odoo dependencies

If you encounter errors with psycopg2, try installing it by specifying system libraries:


sudo apt install libpq-dev -y # Install library for PostgreSQL
sudo /opt/odoo/odoo17-venv/bin/pip install psycopg2-binary

5. Installing Wkhtmltopdf

The wkhtmltopdf utility is required for generating PDF reports in Odoo. It is important to use a version compatible with your Odoo.


sudo apt install xfonts-base -y # Install basic fonts
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb # Download wkhtmltopdf (a different version might be needed for Ubuntu 24.04, check GitHub)
sudo dpkg -i wkhtmltox_0.12.6-1.focal_amd64.deb # Install package
sudo apt --fix-broken install -y # Fix potential dependencies
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin/wkhtmltoimage # Copy executables
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/wkhtmltopdf   # Copy executables

Check the version:


wkhtmltopdf --version

It should be something like wkhtmltopdf 0.12.6.

6. Installing Nginx 1.26

Nginx will act as a reverse proxy for Odoo, providing better performance, security, and the ability to use SSL.


sudo apt install nginx -y # Install Nginx (current version 1.26 as of 2026)
sudo systemctl start nginx # Start Nginx
sudo systemctl enable nginx # Enable Nginx autostart

By default, Nginx listens on port 80. You can check its operation by opening your VPS's IP address in a browser.

Configuration

Now that all components are installed, they need to be properly configured to work together. We will configure Odoo, Nginx, and obtain SSL certificates from Let's Encrypt.

1. Odoo Configuration

We will create a configuration file for Odoo. It is important to store the master password and other sensitive data in this file, but not to make it publicly accessible.


sudo nano /etc/odoo/odoo.conf

Add the following content. Replace your_master_password with a strong, complex password. Remember it, as it will be needed to manage Odoo databases via the web interface.


[options]
; This is the master password for managing Odoo databases (creation, deletion, backup)
; Use a strong, unique password!
admin_passwd = your_master_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo17/addons
xmlrpc_port = 8069
longpolling_port = 8072
logfile = /var/log/odoo/odoo.log
logrotate = True
limit_time_cpu = 600
limit_time_real = 1200
workers = 0 ; Set 0 for debugging, >0 for production (2 * CPU_cores + 1)
max_cron_threads = 1

Note on workers: For production, it is recommended to set workers to (2 * CPU_cores) + 1. For example, for a 4-core VPS, this would be (2 * 4) + 1 = 9. Setting workers = 0 runs Odoo in debug mode with a single thread, which is convenient for initial setup but not suitable for production.

Create a directory for logs and set the correct permissions:


sudo mkdir /var/log/odoo
sudo chown odoo:odoo /var/log/odoo

2. Creating an Odoo System Service

We will create a Systemd unit file to manage Odoo as a service.


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

Add the following content:


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

[Service]
Type=simple
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo17-venv/bin/python3 /opt/odoo/odoo17/odoo-bin -c /etc/odoo/odoo.conf
WorkingDirectory=/opt/odoo/odoo17
StandardOutput=journal+console
StandardError=journal+console
Restart=always
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Save the file and reload Systemd, then start and enable the Odoo service:


sudo systemctl daemon-reload # Reload Systemd configuration
sudo systemctl start odoo # Start Odoo service
sudo systemctl enable odoo # Enable Odoo service autostart
sudo systemctl status odoo # Check Odoo status

You should see the status active (running). Odoo is now listening on port 8069.

3. Configuring Nginx as a Reverse Proxy

We will create an Nginx configuration file for your domain. Replace your_domain.com with your actual domain.


sudo nano /etc/nginx/conf.d/odoo.conf # Use conf.d for a separate file

Add the following content. This is a basic configuration for proxying Odoo traffic with WebSocket support.


upstream odoo {
    server 127.0.0.1:8069; # Odoo Port
}

upstream odoo_longpolling {
    server 127.0.0.1:8072; # Odoo Longpolling Port
}

server {
    listen 80;
    server_name your_domain.com www.your_domain.com; # Replace with your domain

    # Redirect HTTP to HTTPS (will be configured by Certbot)
    # return 301 https://$host$request_uri;
}

# Server for HTTPS (currently commented out, will be populated by Certbot)
# server {
#     listen 443 ssl;
#     server_name your_domain.com www.your_domain.com;
#
#     ssl_certificate /etc/letsencrypt/live/your_domain.com/fullchain.pem;
#     ssl_certificate_key /etc/letsencrypt/live/your_domain.com/privkey.pem;
#     ssl_protocols TLSv1.2 TLSv1.3;
#     ssl_prefer_server_ciphers on;
#     ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
#     ssl_session_cache shared:SSL:10m;
#     ssl_session_timeout 10m;
#
#     proxy_read_timeout 720s;
#     proxy_connect_timeout 720s;
#     proxy_send_timeout 720s;
#
#     # Odoo Longpolling
#     location /longpolling {
#         proxy_pass http://odoo_longpolling;
#         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#         proxy_set_header X-Real-IP $remote_addr;
#         proxy_set_header Host $host;
#         proxy_set_header X-Forwarded-Proto $scheme;
#         proxy_http_version 1.1;
#         proxy_set_header Upgrade $http_upgrade;
#         proxy_set_header Connection "upgrade";
#     }
#
#     # Odoo Web
#     location / {
#         proxy_pass http://odoo;
#         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#         proxy_set_header X-Real-IP $remote_addr;
#         proxy_set_header Host $host;
#         proxy_set_header X-Forwarded-Proto $scheme;
#     }
#
#     # Static files (caching can be configured)
#     location ~* /web/static/ {
#         proxy_cache_valid 200 60m;
#         proxy_buffering on;
#         expires 864000;
#         proxy_pass http://odoo;
#     }
#
#     gzip_static on;
# }

Save the file. Test the Nginx configuration and restart it:


sudo nginx -t # Check Nginx syntax
sudo systemctl restart nginx # Restart Nginx

Remove the default Nginx config to avoid conflicts:


sudo rm /etc/nginx/sites-enabled/default
sudo systemctl reload nginx

At this stage, Odoo should be accessible via your domain over HTTP (port 80).

4. Setting up TLS/HTTPS via Let's Encrypt with Certbot

We will install Certbot, which will automatically configure Nginx to use Let's Encrypt SSL certificates.


sudo apt install certbot python3-certbot-nginx -y # Install Certbot and Nginx plugin

Run Certbot. It will scan your Nginx configuration and suggest domains for certificate acquisition.


sudo certbot --nginx -d your_domain.com -d www.your_domain.com # Replace with your domain

Follow the instructions: enter your email address, agree to the terms of service, and choose whether you want to redirect HTTP traffic to HTTPS (recommended). Certbot will automatically modify your /etc/nginx/conf.d/odoo.conf file, adding the necessary configuration for SSL and redirection.

Verify that automatic certificate renewal is working:


sudo certbot renew --dry-run # Test certificate renewal

If the command completes without errors, automatic renewal will work via Certbot's cron job.

5. Verifying Functionality

Open your domain (https://your_domain.com) in a web browser. You should see the Odoo installation page prompting you to create a new database. Ensure that the connection is secure (green padlock in the address bar).

You can also check Odoo and Nginx availability using curl:


curl -I https://your_domain.com # Check HTTP headers
curl http://127.0.0.1:8069 # Check direct Odoo access

In the first case, you should see Nginx headers and HTTPS information. In the second, Odoo headers.

Backups and Maintenance

Regular backups are a critical part of operating any production service. Odoo stores its data in a PostgreSQL database and has some files on disk. We will set up a simple script for automatic backups.

1. What to Back Up

  • PostgreSQL Database: Contains all Odoo business data. This is the most important component.
  • Odoo Configuration Files: /etc/odoo/odoo.conf and /etc/systemd/system/odoo.service.
  • Custom Modules and Attachments: If you use your own modules, they are usually located in /opt/odoo/odoo17/addons or in a separate directory. Attachments (user-uploaded files) are stored in the filestore directory within the Odoo data directory (by default /opt/odoo/.local/share/Odoo/filestore/).
  • Nginx Configuration: /etc/nginx/conf.d/odoo.conf.
  • Let's Encrypt Certificates: Although they are automatically renewed, having a copy of them doesn't hurt (/etc/letsencrypt/).

2. Simple Auto-Backup Script

Let's create a script that will dump the database and archive important files.


sudo mkdir -p /opt/odoo/backups
sudo chown odoo:odoo /opt/odoo/backups
sudo nano /opt/odoo/backup_script.sh

Add the following content. Replace your_odoo_db_name with the name of your Odoo database (you will see it when creating the DB in the web interface).


#!/bin/bash

# Backup directory
BACKUP_DIR="/opt/odoo/backups"
DATE=$(date +%Y%m%d_%H%M%S)
DB_NAME="your_odoo_db_name" # Your Odoo database name
ODOO_CONF="/etc/odoo/odoo.conf"
ODOO_SERVICE="/etc/systemd/system/odoo.service"
NGINX_CONF="/etc/nginx/conf.d/odoo.conf"
LETSENCRYPT_DIR="/etc/letsencrypt"
ODOO_HOME="/opt/odoo"
ODOO_FILENAMES_DIR="/opt/odoo/.local/share/Odoo/filestore/${DB_NAME}" # Path to Odoo filestore

# Create directory for current backup
CURRENT_BACKUP_DIR="${BACKUP_DIR}/odoo_backup_${DATE}"
mkdir -p "$CURRENT_BACKUP_DIR"

echo "Starting Odoo backup..."

# 1. PostgreSQL Database Backup
echo "Dumping PostgreSQL database..."
sudo -u postgres pg_dump "$DB_NAME" > "${CURRENT_BACKUP_DIR}/${DB_NAME}.sql"
if [ $? -eq 0 ]; then
    echo "Database dump successfully created."
else
    echo "Error creating database dump."
    exit 1
fi

# 2. Copying Configuration Files
echo "Copying configuration files..."
cp "$ODOO_CONF" "$CURRENT_BACKUP_DIR/"
cp "$ODOO_SERVICE" "$CURRENT_BACKUP_DIR/"
cp "$NGINX_CONF" "$CURRENT_BACKUP_DIR/"

# 3. Copying Attachments Directory (filestore)
if [ -d "$ODOO_FILENAMES_DIR" ]; then
    echo "Copying attachments directory (filestore)..."
    cp -R "$ODOO_FILENAMES_DIR" "$CURRENT_BACKUP_DIR/"
else
    echo "Attachments directory not found: $ODOO_FILENAMES_DIR. Skipping."
fi

# 4. Copying Custom Modules (if they are in a separate directory)
# Example: if you have custom modules in /opt/odoo/custom_addons
# if [ -d "/opt/odoo/custom_addons" ]; then
#     echo "Copying custom modules..."
#     cp -R /opt/odoo/custom_addons "$CURRENT_BACKUP_DIR/"
# else
#     echo "Custom modules directory not found. Skipping."
# fi

# 5. Archiving the entire backup
echo "Archiving backup..."
tar -czf "${BACKUP_DIR}/odoo_backup_${DATE}.tar.gz" -C "$CURRENT_BACKUP_DIR" .
if [ $? -eq 0 ]; then
    echo "Backup successfully archived: ${BACKUP_DIR}/odoo_backup_${DATE}.tar.gz"
    rm -rf "$CURRENT_BACKUP_DIR" # Deleting temporary directory
else
    echo "Error archiving backup."
    exit 1
fi

# 6. Deleting old backups (e.g., keep last 7 days)
echo "Deleting old backups (older than 7 days)..."
find "$BACKUP_DIR" -type f -name "*.tar.gz" -mtime +7 -delete
echo "Backup completed."

Make the script executable:


sudo chmod +x /opt/odoo/backup_script.sh

Test the script by running it manually:


sudo /opt/odoo/backup_script.sh

Ensure that an archive has appeared in /opt/odoo/backups.

3. Setting up Cron for Automatic Execution

Let's add the script to the Cron task scheduler so that it runs automatically, for example, every day at 03:00 AM.


sudo crontab -e

If prompted for an editor, choose nano. Add the following line to the end of the file:


0 3 * * * /opt/odoo/backup_script.sh > /dev/null 2>&1

This line means: "Every day at 3 hours 0 minutes, run the script and redirect output to /dev/null".

4. Where to Store (External S3 / Separate VPS)

Storing backups on the same server as the main service is extremely risky. If the server fails or is compromised, you will lose both data and backups. It is recommended to use external storage:

  • S3-compatible storage: Cloud services such as Amazon S3, DigitalOcean Spaces, Backblaze B2, or MinIO on another server. For this, you can integrate s3cmd or rclone into your backup script.
  • Separate VPS: You can rent a small, inexpensive VPS and use rsync or scp to regularly synchronize backups to it.
  • NFS share or network storage: If you have your own infrastructure, you can mount a network drive.

Example of adding rclone for S3 storage (requires prior rclone config setup):


# Add to your backup_script.sh script after archiving
echo "Uploading backup to S3..."
/usr/bin/rclone copy "${BACKUP_DIR}/odoo_backup_${DATE}.tar.gz" "your_s3_remote_name:your_s3_bucket_name/"
if [ $? -eq 0 ]; then
    echo "Backup successfully uploaded to S3."
else
    echo "Error uploading backup to S3."
fi

5. Updates: rolling vs maintenance window

Odoo, like any complex system, requires regular updates. There are two main approaches:

  • Rolling updates: Applied to individual components without full system downtime. For Odoo, this could be module updates or minor fixes. Requires a carefully planned architecture (e.g., a cluster of multiple Odoo instances) and is not always applicable to major updates.
  • Maintenance window: A scheduled period of system downtime to perform major updates (e.g., from Odoo 17 to Odoo 18), OS updates, PostgreSQL, etc. This is the most common and safest approach for a single VPS.

For Odoo on a VPS, the maintenance window approach is recommended. Plan updates during periods of minimal activity, after creating a full backup. The process of updating Odoo between major versions can be complex and often requires database migration, so always test updates on a copy of the production system.

To update Odoo's Python dependencies:


sudo systemctl stop odoo
sudo su - odoo -s /bin/bash
cd /opt/odoo/odoo17
/opt/odoo/odoo17-venv/bin/pip install --upgrade -r requirements.txt
exit
sudo systemctl start odoo

To update Odoo itself (if you cloned from git):


sudo systemctl stop odoo
sudo su - odoo -s /bin/bash
cd /opt/odoo/odoo17
git pull origin 17.0 # Or your other branch
exit
sudo systemctl start odoo

Always carefully read the Odoo changelog before updating and test on a staging environment.

Troubleshooting + FAQ

This section collects common problems and questions that may arise during the installation and operation of Odoo on a VPS.

Odoo does not start or returns a 500/502 error in the browser. What to check?

First, check Odoo logs: sudo journalctl -u odoo.service or sudo tail -f /var/log/odoo/odoo.log. Look for error messages. Common causes: incorrect path to Python interpreter, missing dependencies, issues connecting to PostgreSQL (wrong user/password, PostgreSQL not running), syntax errors in odoo.conf. Also check the Odoo service status: sudo systemctl status odoo.

Nginx returns a 502 Bad Gateway error.

This means that Nginx cannot connect to the Odoo backend. Make sure the Odoo service is running and listening on port 8069 (sudo systemctl status odoo, sudo ss -tulpn | grep 8069). Check the Nginx configuration for typos in proxy_pass. Also, check Nginx logs: sudo tail -f /var/log/nginx/error.log.

I cannot obtain an SSL certificate from Let's Encrypt.

Ensure that your domain correctly points to your VPS's IP address (check the A-record in DNS). Make sure ports 80 and 443 are open in your firewall (sudo ufw status). Temporarily disable Nginx or ensure that Certbot can use it for domain verification. Check Certbot logs if available.

Odoo is very slow. How to optimize?

Check how much RAM is available (free -h). Odoo can be demanding on RAM. Increase the number of workers in odoo.conf (workers = (2 * CPU_cores) + 1) and restart Odoo. Ensure the disk is SSD or NVMe. Consider PostgreSQL optimization (postgresql.conf settings, e.g., shared_buffers, work_mem). Make sure Odoo is not running in debug mode (--dev flag or workers=0).

What is the minimum suitable VPS configuration?

For one to two users with basic Odoo modules, the minimum requirements are 1 vCPU, 2 GB RAM, and 40 GB SSD. However, for more comfortable operation and growth potential, it is recommended to start with 2 vCPU, 4 GB RAM, and 80 GB NVMe SSD. This will provide better system responsiveness and room for future expansions.

What to choose — VPS or dedicated for this task?

For most small and medium-sized businesses, a VPS is an optimal choice, offering a good balance of cost, performance, and flexibility. Dedicated servers become necessary for very high loads (hundreds of active users), strict requirements for guaranteed performance without "neighbors", the need for specific hardware (e.g., RAID arrays), or huge data volumes. If you are just starting with Odoo or your team does not exceed 50-70 users, a VPS will most likely be more than sufficient.

I want to install custom Odoo modules. Where should I put them?

Create a separate directory for custom modules, for example, /opt/odoo/custom_addons. Ensure that the odoo user has access to it. Then add this directory to the addons_path parameter in /etc/odoo/odoo.conf, separating paths with commas: addons_path = /opt/odoo/odoo17/addons,/opt/odoo/custom_addons. After this, restart Odoo and update the app list in the web interface.

Conclusions and Next Steps

Congratulations! You have successfully installed and configured Odoo on your VPS server, ensuring its operability, security with HTTPS, and reliable backup. Now you have a powerful platform to manage all aspects of your business, completely under your control.

Here are some practical steps you can take next:

  • Data Import and Odoo Configuration: Start by creating a database in the Odoo web interface, then import existing data (customers, products, orders) and configure the main modules according to your business processes.
  • Performance Monitoring: Install monitoring tools (e.g., Prometheus + Grafana or Netdata) to track CPU, RAM, disk, and network traffic load. This will help you identify bottlenecks and plan for scaling.
  • PostgreSQL Performance Optimization: For large databases and high load, study postgresql.conf parameters such as shared_buffers, work_mem, effective_cache_size to fine-tune database performance to your needs.
  • Horizontal Scaling: If a single VPS becomes insufficient, consider separating components: a dedicated VPS for the PostgreSQL database, multiple Odoo instances behind a load balancer (Nginx or Haproxy).
  • Custom Module Development: Study Odoo's module development documentation to adapt the system to your unique business requirements or integrate it with other systems.

Was this guide helpful?

Your feedback helps us improve our guides.

Share this post:

Send this guide to someone who may find it useful.

Telegram VKVK WhatsApp Facebook LinkedIn XX

Odoo installation on VPS: PostgreSQL, Nginx, Let's Encrypt, and automatic backups
support_agent
Valebyte Support
Usually replies within minutes
Hi there!
Send us a message and we'll reply as soon as possible.