Why Self-Host Odoo?
Self-hosted Odoo gives you full control over your ERP infrastructure. Unlike managed platforms like Odoo.sh where you are locked into their servers, self-hosting lets you pick your cloud provider, configure the server exactly how you need it, and keep costs predictable.
Full Infrastructure Control
Choose your cloud provider (Hetzner, AWS, DigitalOcean, GCP, Azure, Vultr) based on price, location, and performance. Root SSH access to configure PostgreSQL, Nginx, Redis, and workers to match your workload.
No Vendor Lock-In
Self-hosted Odoo runs on standard Linux servers. Move between cloud providers anytime by migrating your database and filestore. No proprietary deployment formats or locked Git workflows.
Community Edition: Truly Free
Odoo Community Edition is LGPL-licensed and free to self-host. Combined with a $5/mo VPS, you get a production ERP for less than a coffee subscription. 1000+ OCA modules add functionality without Enterprise license fees.
Data Sovereignty & Compliance
Host in any region for GDPR, data residency, or internal compliance requirements. Your data stays on servers you control, so you decide the backup schedule, retention policy, and access controls.
Self-Hosted Odoo Pricing (2026)
The cost of self-hosting Odoo depends on your cloud provider and whether you use a management platform. Here is the realistic cost breakdown:
| Approach | Infra Cost | Platform Fee | Your Time | Total |
|---|---|---|---|---|
| Manual self-host (this guide) | $5–80/mo | $0 | 5–10 hrs/mo | $5–80/mo + time |
| OEC.sh (managed self-host) | $5–80/mo | $0–39/mo | <1 hr/mo | $5–119/mo |
| Odoo.sh (official PaaS) | Included | $32+/mo | <1 hr/mo | $32+/mo (Enterprise only) |
Cheapest self-hosted setup: Hetzner CX22 ($4/mo) + Odoo Community + OEC.sh free tier = $4/month total for a production Odoo instance.
For detailed plan comparison, see our pricing page and hosting comparison.
1Prerequisites
Before you start, make sure you have the following ready. This guide assumes basic Linux command-line knowledge.
Server Requirements
- Minimum 2 CPU cores (4+ recommended)
- Minimum 4GB RAM (8GB+ recommended)
- 40GB+ SSD storage
- Ubuntu 22.04 LTS
Other Requirements
- Domain name pointed to server IP
- SSH access (root or sudo user)
- Basic Linux command knowledge
- Text editor (nano, vim, etc.)
Time Estimate
This manual deployment process typically takes 2-4 hours, including troubleshooting. If you prefer a faster approach, OEC.sh can deploy Odoo in under 5 minutes.
2Server Setup
First, SSH into your server and update the system packages. Then install all the required dependencies for Odoo.
Update System Packages
# Update package list and upgrade all packagessudo apt update && sudo apt upgrade -y# Install essential build toolssudo apt install -y build-essential wget curl gitInstall Python and Dependencies
Odoo is built with Python. Install Python 3 and all required development libraries:
# Install Python 3 and pipsudo apt install -y python3-pip python3-dev python3-venv python3-wheel# Install Odoo dependenciessudo apt install -y libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev \ libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev \ liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev \ libpq-dev# Install Node.js for asset compilationsudo apt install -y nodejs npmsudo npm install -g rtlcssInstall wkhtmltopdf
wkhtmltopdf is required for generating PDF reports in Odoo:
# Download wkhtmltopdf with patched Qtwget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb# Install the packagesudo apt install -y ./wkhtmltox_0.12.6.1-3.jammy_amd64.deb# Verify installationwkhtmltopdf --version3PostgreSQL Installation
PostgreSQL is the only database officially supported by Odoo. Install and configure it for optimal performance.
# Install PostgreSQLsudo apt install -y postgresql postgresql-contrib# Start and enable PostgreSQL servicesudo systemctl start postgresqlsudo systemctl enable postgresql# Create Odoo database usersudo -u postgres createuser --createdb --no-superuser --no-createrole odoo# Set password for the odoo user (optional but recommended)sudo -u postgres psql -c "ALTER USER odoo WITH PASSWORD 'your_secure_password';"Optimize PostgreSQL Configuration
Edit the PostgreSQL configuration for better performance with Odoo:
# Edit /etc/postgresql/14/main/postgresql.conf# Memory settings (adjust based on your RAM)shared_buffers = 2GB # 25% of total RAMeffective_cache_size = 6GB # 75% of total RAMwork_mem = 64MBmaintenance_work_mem = 512MB# Connection settingsmax_connections = 200# Write-Ahead Logwal_buffers = 64MBcheckpoint_completion_target = 0.9# Planner settingsrandom_page_cost = 1.1 # For SSD storageeffective_io_concurrency = 200 # For SSD storage# Restart PostgreSQL to apply changessudo systemctl restart postgresql4Odoo Installation
There are two methods to install Odoo: from source (recommended for customization) or from the official DEB package (simpler setup).
Method 1: Install from Source (Recommended)
# Create odoo system usersudo useradd -m -d /opt/odoo -U -r -s /bin/bash odoo# Switch to odoo usersudo su - odoo# Clone Odoo repository (version 17.0)git clone https://github.com/odoo/odoo.git --depth 1 --branch 17.0 /opt/odoo/odoo# Create Python virtual environmentpython3 -m venv /opt/odoo/venv# Activate virtual environmentsource /opt/odoo/venv/bin/activate# Install Python dependenciespip install wheelpip install -r /opt/odoo/odoo/requirements.txt# Exit odoo userexitCreate Odoo Configuration File
# Create /etc/odoo/odoo.conf[options]; Database settingsadmin_passwd = your_admin_master_passworddb_host = localhostdb_port = 5432db_user = odoodb_password = your_secure_password; Pathsaddons_path = /opt/odoo/odoo/addons,/opt/odoo/custom-addonsdata_dir = /opt/odoo/.local/share/Odoo; Server settingshttp_port = 8069longpolling_port = 8072proxy_mode = True; Logginglogfile = /var/log/odoo/odoo.loglog_level = info; Securitylist_db = False# Create necessary directoriessudo mkdir -p /etc/odoo /var/log/odoo /opt/odoo/custom-addonssudo chown -R odoo:odoo /var/log/odoo /opt/odoo/custom-addons# Create the config filesudo nano /etc/odoo/odoo.confCreate Systemd Service
# Create /etc/systemd/system/odoo.service[Unit]Description=OdooDocumentation=https://www.odoo.comAfter=network.target postgresql.service[Service]Type=simpleSyslogIdentifier=odooPermissionsStartOnly=trueUser=odooGroup=odooExecStart=/opt/odoo/venv/bin/python3 /opt/odoo/odoo/odoo-bin -c /etc/odoo/odoo.confStandardOutput=journal+consoleRestart=on-failureRestartSec=5[Install]WantedBy=multi-user.target# Reload systemd and start Odoosudo systemctl daemon-reloadsudo systemctl enable odoosudo systemctl start odoo# Check statussudo systemctl status odoo5Nginx Configuration
Nginx acts as a reverse proxy, handling SSL termination, load balancing, and serving static files efficiently.
# Install Nginxsudo apt install -y nginx# Start and enable Nginxsudo systemctl start nginxsudo systemctl enable nginxCreate Nginx Server Block
1# Create /etc/nginx/sites-available/odoo23upstream odoo {4server 127.0.0.1:8069;5}67upstream odoo-chat {8server 127.0.0.1:8072;9}1011server {12listen 80;13server_name your-domain.com;1415 # Redirect to HTTPS (enable after SSL setup)16 # return 301 https://$host$request_uri;1718 proxy_read_timeout 720s;19 proxy_connect_timeout 720s;20 proxy_send_timeout 720s;2122 # Proxy headers23proxy_set_header X-Forwarded-Host $host;24proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;25proxy_set_header X-Forwarded-Proto $scheme;26proxy_set_header X-Real-IP $remote_addr;2728 # Log files29access_log /var/log/nginx/odoo.access.log;30error_log /var/log/nginx/odoo.error.log;3132 # Increase proxy buffer size33 proxy_buffers 16 64k;34 proxy_buffer_size 128k;3536 # Longpolling37location /longpolling {38proxy_pass http://odoo-chat;39 }4041 # Handle all other requests42location / {43 proxy_redirect off;44proxy_pass http://odoo;45 }4647 # Cache static files48location ~* /web/static/ {49 proxy_cache_valid 200 90m;50 proxy_buffering on;51 expires 864000;52proxy_pass http://odoo;53 }5455 # Gzip compression56 gzip_types text/css text/scss text/plain text/xml application/xml application/json application/javascript;57 gzip on;58}# Enable the sitesudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/# Remove default site (optional)sudo rm /etc/nginx/sites-enabled/default# Test Nginx configurationsudo nginx -t# Reload Nginxsudo systemctl reload nginx6SSL Setup with Let's Encrypt
Secure your Odoo installation with a free SSL certificate from Let's Encrypt using Certbot.
# Install Certbotsudo apt install -y certbot python3-certbot-nginx# Obtain SSL certificate (replace with your domain)sudo certbot --nginx -d your-domain.com# Test auto-renewalsudo certbot renew --dry-runCertbot will automatically modify your Nginx configuration to use HTTPS. The certificate auto-renews every 90 days via a cron job.
Checkpoint
At this point, you should be able to access Odoo at https://your-domain.com. The database manager will appear for first-time setup.
7Production Optimization
Configure Odoo workers, memory limits, and logging for production workloads.
Worker Configuration Formula
Use this formula to calculate the optimal number of workers:
- 4 CPU cores = 9 workers
- 8 CPU cores = 17 workers
- Each worker uses ~150-300MB RAM
# Update /etc/odoo/odoo.conf with production settings[options]; Worker settings (for 4 CPU cores, 8GB RAM)workers = 9max_cron_threads = 2; Memory limits (in bytes)limit_memory_hard = 2684354560 ; 2.5GBlimit_memory_soft = 2147483648 ; 2GB; Time limits (in seconds)limit_time_cpu = 600limit_time_real = 1200; Request limitslimit_request = 8192; Databasedb_maxconn = 64; Logginglog_level = warnlog_handler = :INFO; Security (important for production)list_db = False# Restart Odoo to apply changessudo systemctl restart odoo# Monitor Odoo processesps aux | grep odooConfigure Logrotate
# Create /etc/logrotate.d/odoo/var/log/odoo/*.log { daily rotate 14 compress delaycompress missingok notifempty copytruncate}8Backup Configuration
Set up automated backups for your Odoo database and filestore. Without regular backups, a disk failure or bad migration can mean permanent data loss.
Create Backup Script
1#!/bin/bash2# /opt/odoo/backup.sh34# Configuration5BACKUP_DIR="/opt/odoo/backups"6DB_NAME="your_database_name"7FILESTORE_DIR="/opt/odoo/.local/share/Odoo/filestore/$DB_NAME"8DATE=$(date +%Y-%m-%d_%H-%M-%S)9RETENTION_DAYS=301011# Create backup directory12mkdir -p $BACKUP_DIR1314# Backup database15sudo -u postgres pg_dump $DB_NAME | gzip > $BACKUP_DIR/db_$DATE.sql.gz1617# Backup filestore18tar -czf $BACKUP_DIR/filestore_$DATE.tar.gz -C $FILESTORE_DIR .1920# Create combined backup21tar -czf $BACKUP_DIR/full_backup_$DATE.tar.gz \22 $BACKUP_DIR/db_$DATE.sql.gz \23 $BACKUP_DIR/filestore_$DATE.tar.gz2425# Clean up individual files26rm $BACKUP_DIR/db_$DATE.sql.gz27rm $BACKUP_DIR/filestore_$DATE.tar.gz2829# Remove old backups30find $BACKUP_DIR -type f -name "full_backup_*.tar.gz" -mtime +$RETENTION_DAYS -delete3132echo "Backup completed: full_backup_$DATE.tar.gz"# Make script executablesudo chmod +x /opt/odoo/backup.sh# Test the backup scriptsudo /opt/odoo/backup.shSchedule Automated Backups
# Open crontab editorsudo crontab -e# Add daily backup at 2 AM0 2 * * * /opt/odoo/backup.sh >> /var/log/odoo/backup.log 2>&1Pro Tip
For production systems, also upload backups to external storage like AWS S3 or Cloudflare R2 for offsite redundancy.
9Cloud Provider-Specific Deployment Guides
The steps above work for any VPS or cloud server. For provider-specific optimizations, networking configurations, and best practices, check out our detailed guides:
Deploy Odoo on AWS
Complete guide for deploying Odoo on Amazon Web Services using EC2, RDS, and S3 for backups.
Read guide →Deploy Odoo on Google Cloud
Step-by-step guide for Google Cloud Platform using Compute Engine and Cloud SQL.
Read guide →Deploy Odoo on Azure
Deploy Odoo on Microsoft Azure with Virtual Machines and Azure Database for PostgreSQL.
Read guide →Deploy Odoo on DigitalOcean
Budget-friendly Odoo deployment on DigitalOcean Droplets with managed databases.
Read guide →Deploy Odoo on Hetzner
Best price-performance ratio. Deploy Odoo on Hetzner Cloud servers in Europe.
Read guide →Or Deploy to All Providers with OEC.sh
Deploy to AWS, GCP, Azure, DigitalOcean, Hetzner, and 9+ more providers with one unified interface.
Start Free DeploymentSelf-Hosted vs Managed Hosting
Self-hosting Odoo gives you maximum control, but it comes with maintenance overhead. Managed platforms reduce operational burden while limiting some flexibility.
| Factor | Self-Hosted (Manual) | OEC.sh (Managed) |
|---|---|---|
| Cloud provider choice | Any provider | Any provider |
| SSH / root access | Full root | Full SSH |
| Setup time | 2-4 hours | 5 minutes |
| SSL certificates | Manual (Certbot) | Automatic |
| Backups | Configure yourself | Automated to S3/R2 |
| Monitoring | Set up Prometheus/etc. | Built-in dashboard |
| OCA modules | Install manually | Supported natively |
| Monthly maintenance | 5-10 hours | Under 1 hour |
| Cost (small instance) | $5-12/mo | $5-12/mo + $0-19/mo |
OEC.sh bridges the gap: you keep self-hosted infrastructure on your own cloud account, but the platform handles deployment, SSL, backups, and monitoring. The free tier covers 1 server and 2 projects with no credit card required.
10Or Skip All This with OEC.sh
Deploy in 5 Minutes Instead of 2-4 Hours
The manual deployment process above typically takes 2-4 hours including troubleshooting, and requires ongoing maintenance for security updates, backups, and monitoring.
With OEC.sh, you can deploy Odoo to any of 8+ cloud providers in under 5 minutes with:
- One-click deployment with automatic SSL
- Automated daily backups to 7+ storage providers
- Built-in PostgreSQL optimization
- Zero-downtime updates and rollbacks
- 24/7 monitoring and alerting
- Git integration with auto-deploy on push
11Frequently Asked Questions
Related Guides
Skip the manual setup?
OEC.sh automates Odoo deployment on any cloud — SSL, backups, monitoring, and scaling included. Deploy in minutes, not hours.
Odoo Docker Deployment
Production-ready Docker Compose setup for Odoo with PostgreSQL.
SSL and Custom Domains
Configure HTTPS, SSL certificates, and custom domains for Odoo.
Performance Optimization
Tune PostgreSQL and Odoo for maximum performance.
Backup and Recovery
Automated backup strategies and disaster recovery for Odoo.
CI/CD and Staging
Set up staging environments and CI/CD pipelines for Odoo.
Install Odoo on Ubuntu
Step-by-step installation guide for Ubuntu 22.04/24.04.
Nginx Reverse Proxy for Odoo
Configure Nginx with SSL termination and WebSocket support.
OEC.sh vs Odoo.sh
Compare hosting options and save up to 70% on costs.