🎓

Odoo

4 notes  •  LMS & Business Apps

Install Odoo 11 on AWS EC2

Odoo 11 can be deployed on an AWS EC2 instance running Ubuntu. This guide covers installing Odoo from the official repository and configuring it for production use.

Prerequisites

  • AWS EC2 instance (Ubuntu 16.04 or 18.04, t2.medium or larger recommended)
  • Security group with ports 22, 80, 443, and 8069 open
  • A domain name pointed to the EC2 Elastic IP (optional)

Steps

# Update system
sudo apt-get update && sudo apt-get upgrade -y

# Install dependencies
sudo apt-get install -y git python3-pip build-essential wget python3-dev python3-venv \
  libxslt-dev libzip-dev libldap2-dev libsasl2-dev node-less

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

# Install PostgreSQL
sudo apt-get install -y postgresql
sudo su - postgres -c "createuser -s odoo"

# Install wkhtmltopdf
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/\
wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb

# Clone Odoo 11
sudo git clone --depth 1 --branch 11.0 https://www.github.com/odoo/odoo \
  /opt/odoo/odoo

# Install Python requirements
cd /opt/odoo/odoo
sudo pip3 install -r requirements.txt

# Create config file
sudo cp /opt/odoo/odoo/debian/odoo.conf /etc/odoo.conf
sudo chown odoo: /etc/odoo.conf

# Start Odoo
sudo -u odoo /opt/odoo/odoo/odoo-bin -c /etc/odoo.conf

Verify

Open http://<EC2-IP>:8069 in a browser. The Odoo setup wizard should appear.

Notes

  • Place Nginx in front of Odoo on port 80/443 for production use.
  • Set xmlrpc_interface = 127.0.0.1 in /etc/odoo.conf so Odoo only listens on localhost when Nginx handles external requests.

Back Up and Restore the Odoo Knowledge Filestore

Odoo stores uploaded files (attachments, images) either in the database as binary or on disk in a filestore directory. When migrating or backing up Odoo, you must back up the filestore alongside the database to avoid losing files.

Prerequisites

  • SSH access to the Odoo server
  • Know the filestore path (usually /var/lib/odoo/.local/share/Odoo/filestore/)

Backup Steps

# 1. Back up the database
pg_dump -U odoo your_database > odoo_db_backup.sql

# 2. Back up any custom addons
tar -czf custom_addons_backup.tar.gz /opt/odoo/custom-addons/

# 3. Back up the filestore
tar -czf filestore_backup.tar.gz \
  /var/lib/odoo/.local/share/Odoo/filestore/your_database/

Restore Steps

# 1. Create an empty database
createdb -U odoo new_database

# 2. Restore the database
psql -U odoo new_database < odoo_db_backup.sql

# 3. Restore the filestore
tar -xzf filestore_backup.tar.gz -C /

# 4. Restore custom addons
tar -xzf custom_addons_backup.tar.gz -C /

Verify

Start Odoo pointing to the restored database and confirm that attachments and images display correctly.

Notes

  • The filestore directory name matches the database name — rename it if you restore under a new DB name.
  • Odoo's built-in web backup (Settings > Technical > Database Structure > Backup) includes the filestore in the zip download.

Configure Odoo with Amazon RDS (PostgreSQL)

Odoo can use Amazon RDS as its PostgreSQL backend instead of a local database. This offloads database management to AWS and improves reliability for production deployments.

Prerequisites

  • An RDS PostgreSQL instance with a database and user named odoo
  • The RDS security group allows the Odoo EC2 instance to connect on port 5432
  • Odoo installed on the EC2 instance

Steps

Edit /etc/odoo/odoo.conf and set the database connection parameters:

[options]
admin_passwd = your_master_password
db_host = odoo.cwcdvyjnwbfc.ap-south-1.rds.amazonaws.com
db_maxconn = 64
db_name = mrdoo
db_password = your_db_password
db_port = 5432
db_user = odoo
# Restart Odoo to apply the new config
sudo systemctl restart odoo

Verify

sudo journalctl -u odoo -n 50

Check for a successful database connection message. Then open the Odoo web interface and confirm login works.

Notes

  • Create the RDS database with the username odoo so Odoo recognizes it automatically.
  • Use db_maxconn to limit connections — RDS instance size constrains the max connections.
  • Ensure the RDS parameter group has max_connections set appropriately for your instance type.

Configure Odoo with Nginx as a Reverse Proxy

Running Nginx in front of Odoo handles SSL termination, load balancing, and improves security by preventing direct access to Odoo's built-in web server on port 8069.

Prerequisites

  • Odoo installed and running on localhost:8069
  • Nginx installed (sudo apt install nginx)
  • A domain name with DNS pointing to the server
  • SSL certificate (Let's Encrypt recommended)

Steps

# Create Nginx site config
sudo nano /etc/nginx/sites-available/odoo
upstream odoo {
    server 127.0.0.1:8069;
}
upstream odoochat {
    server 127.0.0.1:8072;
}

server {
    listen 80;
    server_name odoo.example.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name odoo.example.com;

    ssl_certificate     /etc/letsencrypt/live/odoo.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/odoo.example.com/privkey.pem;

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

    location / {
        proxy_pass http://odoo;
        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://odoochat;
    }
}
# Enable the site and reload Nginx
sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
# Update odoo.conf so Odoo listens only on localhost
sudo nano /etc/odoo/odoo.conf
# Add:
xmlrpc_interface = 127.0.0.1
netrpc_interface = 127.0.0.1
sudo systemctl restart odoo

Verify

curl -I https://odoo.example.com

You should get a 200 or 302 response. Open the URL in a browser to confirm the Odoo login page loads over HTTPS.

Notes

  • Set proxy_mode = True in odoo.conf so Odoo correctly reads the forwarded IP headers.
  • Increase client_max_body_size in the Nginx server block if users upload large files.