This guide will walk you through the steps to install and configure Odoo 13 on CentOS 7. Odoo is a popular business software with a range of business applications such as CRM, POS, Website builder, Warehouse Management, Project Management, eCommerce, Marketing, Billing & Accounting, Manufacturing among many others. All these applications are seamlessly integrated and are managed from one web console.

As of this article writing, the latest release of Odoo available for download and use is Odoo v13. In the rest of this article, we will install and configure Odoo 13 on CentOS 7. We’ll use PostgreSQL database and Nginx as frontend proxy to Odoo 13 running on CentOS 7.

For Debian / Ubuntu:

Install Odoo 13 on Ubuntu 18.04

Install Odoo 13 on Debian 10

Step 1: Add EPEL Repository

Add EPEL repository to CentOS 7 by running the command.

sudo yum -y install epel-release vim bash-completion

Put SELinux in permissive mode.

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

After adding EPEL repository, I recommend you update your system.

sudo yum -y update

Step 2: Install PostgreSQL Database Server

After adding EPEL repository, install PostgreSQL database server on CentOS 7. As of this writing, the latest release of PostgreSQL is version 12. Install it using our guide.

How to Install PostgreSQL 12 on CentOS 7

Step 3: Install wkhtmltopdf

Odoo uses wkhtmltopdf to generate reports in PDF format. The recommended version of wkhtmltopdf to install is 0.12.5 and is available on the wkhtmltopdf download page, in the archive section.

sudo yum install -y https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm

Confirm installed version.

$ wkhtmltopdf --version
wkhtmltopdf 0.12.5 (with patched qt)

Step 4: Install Odoo 13 on CentOS 7

Let’s now begin installation of Odoo 13 on CentOS 7, we’ll start by adding Odoo Yum repository to our system.

sudo yum -y install yum-utils
sudo yum-config-manager --add-repo=http://nightly.odoo.com/13.0/nightly/rpm/odoo.repo

The repository file will be added to /etc/yum.repos.d/odoo.repo.

Update packages index and install Odoo 13 on CentOS 7.

sudo yum makecache fast
sudo yum install odoo

A number of dependency packages are installed from Base and EPEL repository we added earlier. Press the y key to start installation of Odoo 13 on CentOS 7.

Accept importation of GPG key when you receive a prompt.

Retrieving key from https://nightly.odoo.com/odoo.key
Importing GPG key 0x8183CBB5:
 Userid     : "Odoo SA, Linux Package Signing Key <[email protected]>"
 Fingerprint: 5d13 4c92 4cb0 6330 dcef e2a1 def2 a219 8183 cbb5
 From       : https://nightly.odoo.com/odoo.key
Is this ok [y/N]: y

An odoo systemd service is created but not started. Let’s start it and set to start and boot time.

sudo systemctl enable --now odoo

Confirm if Odoo service is set to start at boot.

$ systemctl is-enabled odoo
enabled

Check if running.

$ systemctl status odoo
● odoo.service - Odoo Open Source ERP and CRM
   Loaded: loaded (/usr/lib/systemd/system/odoo.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2019-10-21 10:38:53 UTC; 1min 22s ago
 Main PID: 15559 (odoo)
   CGroup: /system.slice/odoo.service
           └─15559 /usr/bin/python /usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log

Oct 21 10:38:53 cent7.novalocal systemd[1]: Started Odoo Open Source ERP and CRM.

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

$ ss -tunelp | grep 8069
tcp    LISTEN  0  128 *:8069  *:*  uid:997 ino:67021 sk:ffff911b7549ae80 <->

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

Install Nginx on CentOS 7

sudo yum -y install nginx
sudo systemctl enable --now nginx

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 applicationhttps://computingforgeeks.com/json application/javascript;
    gzip on;
}

Replace erp.computingforgeeks with your domain name, then validate Nginx configuration file.

$ 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 all looks good, restart Nginx.

sudo systemctl restart nginx

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

If your server has a public IP, you can create a DNS A record for your domain to point to Odoo Server and request for free Let’s Encrypt SSL certificate.

Install Nginx on CentOS 7

sudo yum -y install nginx
sudo systemctl enable --now nginx

Install certbot-auto tool.

sudo yum -y install wget
wget https://dl.eff.org/certbot-auto
chmod +x certbot-auto
sudo mv certbot-auto /usr/local/bin/certbot-auto

Stop Nginx service.

sudo systemctl stop nginx

Get Let’s Encrypt SSL certificates for your domain.

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

The path to certificate files is shown in the “IMPORTANT NOTES” section.

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-19. 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"
 - 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 applicationhttps://computingforgeeks.com/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 7: Access Odoo on Debian 10 Linux

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

On the first page, set database name, admin user email address and password for the admin user.

Use the Apps menu to install other Odoo applications.

Example:

There you have it. Odoo 13 has been installed on CentOS 7 Linux server. Explore more Odoo features and Applications available for installation. The next page to visit is official Odoo Documentation.

For Debian family, check:

Install Odoo 13 on Ubuntu 18.04

Install Odoo 13 on Debian 10