Introduction
Odoo is a powerful open-source suite of business applications that includes CRM, e-commerce, accounting, inventory management, project management, and much more. With over 30 main applications and thousands of community modules, Odoo provides a comprehensive solution for businesses of all sizes.
Self-hosting Odoo on a RamNode VPS gives you complete control over your data, customization options, and eliminates recurring SaaS subscription costs. This guide walks you through deploying Odoo 17 (the latest stable version) on an Ubuntu 24.04 LTS server.
Prerequisites
Before beginning the installation, ensure you have the following:
| Requirement | Specification |
|---|---|
| VPS Plan | Minimum 2GB RAM, 2 vCPU (4GB+ recommended for production) |
| Operating System | Ubuntu 24.04 LTS (fresh installation) |
| Domain Name | A registered domain with DNS access |
| Root Access | SSH access with root or sudo privileges |
| Disk Space | At least 20GB free space |
Tip: For optimal performance, we recommend the RamNode Premium KVM plan with 4GB RAM or higher for production deployments with multiple users.
Initial Server Setup
Update the System
Start by connecting to your VPS via SSH and updating all system packages:
sudo apt update && sudo apt upgrade -yCreate a Dedicated Odoo User
Create a system user dedicated to running Odoo. This improves security by isolating the application:
sudo useradd -m -d /opt/odoo -U -r -s /bin/bash odooInstall Required Dependencies
sudo apt install -y python3-pip python3-dev python3-venv \
libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev \
libldap2-dev build-essential libssl-dev libffi-dev \
libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev \
liblcms2-dev libblas-dev libatlas-base-dev git \
nodejs npm wkhtmltopdfNote: The wkhtmltopdf package is essential for generating PDF reports in Odoo.
PostgreSQL Database Setup
Odoo uses PostgreSQL as its database backend. Install PostgreSQL and create a dedicated database user:
sudo apt install -y postgresql postgresql-contribCreate Odoo Database User
sudo -u postgres createuser -s odooNote: The -s flag grants superuser privileges, which Odoo needs to create and manage its databases.
Installing Odoo
Clone the Odoo Repository
Switch to the odoo user and clone the official Odoo 17 repository:
sudo su - odoo
git clone https://www.github.com/odoo/odoo --depth 1 --branch 17.0 /opt/odoo/odoo17Set Up Python Virtual Environment
cd /opt/odoo
python3 -m venv odoo-venv
source odoo-venv/bin/activate
pip install wheel
pip install -r odoo17/requirements.txt
deactivateCreate Custom Addons Directory
mkdir /opt/odoo/odoo17-custom-addons
exitConfiguring Odoo
Create the main Odoo configuration file:
sudo nano /etc/odoo.conf[options]
admin_passwd = your_secure_password
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo17/addons,/opt/odoo/odoo17-custom-addons
logfile = /var/log/odoo/odoo.log
log_level = info
xmlrpc_port = 8069
proxy_mode = True
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_time_cpu = 600
limit_time_real = 1200
max_cron_threads = 1
workers = 2Important: Replace 'your_secure_password' with a strong admin password.
Set Permissions
sudo mkdir /var/log/odoo
sudo chown odoo:odoo /var/log/odoo
sudo chown odoo:odoo /etc/odoo.confCreating the Systemd Service
sudo nano /etc/systemd/system/odoo.service[Unit]
Description=Odoo 17
Documentation=https://www.odoo.com
After=network.target postgresql.service
[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo-venv/bin/python3 /opt/odoo/odoo17/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable odoo
sudo systemctl start odoo
sudo systemctl status odooNginx Reverse Proxy Setup
sudo apt install -y nginxCreate Server Block
sudo nano /etc/nginx/sites-available/odooupstream odoo {
server 127.0.0.1:8069;
}
upstream odoochat {
server 127.0.0.1:8072;
}
server {
listen 80;
server_name yourdomain.com;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
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;
access_log /var/log/nginx/odoo.access.log;
error_log /var/log/nginx/odoo.error.log;
location /longpolling {
proxy_pass http://odoochat;
}
location / {
proxy_redirect off;
proxy_pass http://odoo;
}
location ~* /web/static/ {
proxy_cache_valid 200 90m;
proxy_buffering on;
expires 864000;
proxy_pass http://odoo;
}
gzip on;
gzip_types text/css text/plain application/json application/javascript;
gzip_min_length 1000;
}sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxSSL Certificate with Let's Encrypt
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.comCertbot will automatically configure Nginx for SSL and set up automatic certificate renewal. Follow the prompts to complete the setup.
Firewall Configuration
sudo ufw allow ssh
sudo ufw allow 'Nginx Full'
sudo ufw enableThis allows SSH access and HTTP/HTTPS traffic while blocking direct access to the Odoo port (8069).
Performance Optimization
PostgreSQL Tuning
sudo nano /etc/postgresql/16/main/postgresql.confAdjust these parameters based on your VPS resources:
shared_buffers = 512MB
effective_cache_size = 1536MB
maintenance_work_mem = 128MB
work_mem = 16MB
max_connections = 100sudo systemctl restart postgresqlOdoo Worker Configuration
The number of workers in your Odoo configuration should be based on your available CPU cores. A general formula is: workers = (CPU cores × 2) + 1. For a 2 vCPU server, 2-4 workers is appropriate. Each worker consumes approximately 150MB of RAM.
Backup & Maintenance
Automated Database Backups
sudo nano /opt/odoo/backup.sh#!/bin/bash
BACKUP_DIR="/opt/odoo/backups"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
# Backup all Odoo databases
for db in $(sudo -u postgres psql -t -c "SELECT datname FROM pg_database WHERE datname NOT IN ('postgres', 'template0', 'template1')"); do
sudo -u postgres pg_dump $db | gzip > "$BACKUP_DIR/${db}_${DATE}.sql.gz"
done
# Backup filestore
tar -czf "$BACKUP_DIR/filestore_${DATE}.tar.gz" /opt/odoo/.local/share/Odoo/filestore
# Keep only last 7 days of backups
find $BACKUP_DIR -type f -mtime +7 -deletesudo chmod +x /opt/odoo/backup.sh
sudo crontab -eAdd daily backup at 2 AM:
0 2 * * * /opt/odoo/backup.shLog Rotation
sudo nano /etc/logrotate.d/odoo/var/log/odoo/*.log {
daily
rotate 14
compress
delaycompress
notifempty
create 640 odoo odoo
postrotate
systemctl reload odoo > /dev/null 2>&1 || true
endscript
}Troubleshooting
Check the Odoo logs for detailed error information:
sudo tail -f /var/log/odoo/odoo.log🎉 Congratulations!
You now have a fully functional Odoo 17 installation running on your RamNode VPS. This setup provides a secure, production-ready environment with SSL encryption, automated backups, and optimized performance settings.
Access Odoo by navigating to your domain. Use the admin password from your configuration to access the database manager and create your first database. For additional customization, explore the Odoo Apps store for modules that extend functionality.
