Odoo is a set of popular web based open source business applications created to solve all business needs and demands. This guide has been written to help Linux users install Odoo on Debian 10 (Buster) Linux. Odoo comprises of a range of business applications such CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management just to mention a few.

Install Odoo ERP on Debian 10 (Buster) Linux

All the Odoo packages that we’ll need are available on Debian and Odoo repository to be added. We won’t be doing any manual building of packages. Now dive into the installation of Odoo on Debian 10 Linux.

Step 1: Update system

Start by updating your Debian Linux.

sudo apt update
sudo apt -y upgrade

A reboot is necessary whenever an upgrade is performed.

sudo reboot

Step 2: Install PostgreSQL Database

Odoo uses PostgreSQL database as primary storage for its data. The PostgreSQL database server has to be installed manually on our Debian system.

Installing PostgreSQL 12 on Debian

Step 3: Install wkhtmltopdf

Odoo requires wkhtmltopdf for reports generation and printing. The version of wkhtmltopdf available in the upstream Debian repositories does not support headers and footers so it is not used as a direct dependency.

Install wkhtmltopdf & wkhtmltoimage on Ubuntu 18.04 / Debian 10 Linux

Step 4: Install Odoo 13 on Debian 10 (Buster)

Before installing Odoo 13 on Debian 10 (Buster), we need to add Odoo apt repository to our local system.

wget -O - https://nightly.odoo.com/odoo.key | sudo apt-key add -
echo "deb http://nightly.odoo.com/13.0/nightly/deb/ ./" | sudo tee /etc/apt/sources.list.d/odoo.list

Once the repository is added, update your Apt cache and install Odoo 13 on Debian 10.

sudo apt update
sudo apt install odoo

After the installation of Odoo 13 on Debian 10, the service is started automatically.

$ systemctl status odoo
 ● odoo.service - Odoo Open Source ERP and CRM
    Loaded: loaded (/lib/systemd/system/odoo.service; enabled; vendor preset: enabled)
    Active: active (running) since Sat 2019-10-19 20:57:11 UTC; 20s ago
  Main PID: 8793 (odoo)
     Tasks: 4 (limit: 4719)
    Memory: 61.5M
    CGroup: /system.slice/odoo.service
            └─8793 /usr/bin/python3 /usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log
 Oct 19 20:57:11 deb10 systemd[1]: Started Odoo Open Source ERP and CRM.

Set the service to start on every system reboot.

$ sudo systemctl enable --now odoo

The Odoo service should bind to TCP port 8069 once started.

$ ss -tunelp | grep 8069
tcp   LISTEN  0       128                  0.0.0.0:8069           0.0.0.0:*      uid:113 ino:1906251 sk:d <-> 

Step 5: Configure Nginx Proxy (Without SSL) – Not recommended

Install Nginx onto your system:

sudo apt -y install nginx vim

Create a new configuration file for odoo.

sudo vim /etc/nginx/conf.d/odoo.conf

Modify this configuration snippet to fit your setup.

# Odoo Upstreams
upstream odooserver {
 server 127.0.0.1:8069;
}

server {
    listen 80;
    server_name erp.computingforgeeks.com;
    access_log /var/log/nginx/odoo_access.log;
    error_log /var/log/nginx/odoo_error.log;


    # Proxy settings
    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;

    # Request for root domain
    location / {
       proxy_redirect off;
       proxy_pass http://odooserver;
    }

    # Cache static files
    location ~* /web/static/ {
        proxy_cache_valid 200 90m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odooserver;
    }

    # Gzip
    gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
    gzip on;
}

My service domain in this example is erp.computingforgeeks.com, replace it with your correct domain to be used with Odoo. A valid DNS record is required for external access as well.

Check your configuration syntax:

$ sudo nginx  -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If the settings are deemed ok, restart nginx service.

sudo systemctl restart nginx

Step 6: Configure Nginx Proxy (With SSL Certificate) – Recommended

It is always recommended to use SSL encryption for production deployments. Let’s Encrypt is a free SSL offering that you can use in your Setup.

Get Let’s Encrypt SSL certificates for your domain.

wget https://dl.eff.org/certbot-auto
chmod +x certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto
sudo systemctl stop nginx

export DOMAIN="erp.computingforgeeks.com"
export EMAIL="[email protected]"
sudo /usr/local/bin/certbot-auto certonly --standalone -d ${DOMAIN} --preferred-challenges http --agree-tos -n -m ${EMAIL} --keep-until-expiring

If the execution went through, paths to the certificate and chain files will be printed out.

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/erp.computingforgeeks.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/erp.computingforgeeks.com/privkey.pem
   Your cert will expire on 2020-01-17. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot-auto
   again. To non-interactively renew *all* of your certificates, run
   "certbot-auto renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Create cron to renew certificate.

$ sudo crontab -e
15 3 * * * /usr/local/bin/certbot-auto renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"

Create Nginx configuration file.

sudo vim /etc/nginx/conf.d/odoo.conf

Paste below into the file and modify it to suit your environment.

# Odoo Upstreams
upstream odooserver {
 server 127.0.0.1:8069;
}

# http to https redirection
server {
    listen 80;
    server_name erp.computingforgeeks.com;
    return 301 https://erp.computingforgeeks.com$request_uri;
}

server {
    listen 443 ssl;
    server_name erp.computingforgeeks.com;
    access_log /var/log/nginx/odoo_access.log;
    error_log /var/log/nginx/odoo_error.log;
   
   # SSL
    ssl_certificate /etc/letsencrypt/live/erp.computingforgeeks.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/erp.computingforgeeks.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/erp.computingforgeeks.com/chain.pem;


    # Proxy settings
    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;

    # Request for root domain
    location / {
       proxy_redirect off;
       proxy_pass http://odooserver;
    }

    # Cache static files
    location ~* /web/static/ {
        proxy_cache_valid 200 90m;
        proxy_buffering on;
        expires 864000;
        proxy_pass http://odooserver;
    }

    # Gzip Compression
    gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
    gzip on;
}

Validate your Nginx configurations.

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Restart Nginx.

sudo systemctl restart nginx

Step 6: Access Odoo on Debian 10 Linux

Access Odoo Web page on your domain name from a web – https://DNShostname

Set database name, admin user email address and password for the admin user.

Input required details to create Database. After you click “Create Database”, you’ll be redirected to Administration page from where you can install Odoo business applications.

Have a happy time working with Odoo 13 on Debian 10 Linux. Fore more information, visit Odoo documentation page.

Similar guides:

How To Install Odoo 13 on Ubuntu 18.04 Linux

Install Dolibarr ERP & CRM on Ubuntu 18.04 LTS

How to Install ERPNext ERP System on Ubuntu 18.04