Friday, January 3, 2025
Google search engine
HomeGuest BlogsHow To Install Odoo 15 on Ubuntu 20.04|18.04

How To Install Odoo 15 on Ubuntu 20.04|18.04

.tdi_3.td-a-rec{text-align:center}.tdi_3 .td-element-style{z-index:-1}.tdi_3.td-a-rec-img{text-align:left}.tdi_3.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_3.td-a-rec-img{text-align:center}}

In today’s blog post, we’ll discuss how one can install Odoo 15 on Ubuntu 20.04|18.04 Linux system. Odoo is the most trusted suite of web based open source business applications that can help you drive the business in the right direction. Odoo gives you access to critical business applications, all managed from a single console.

A range of business applications available on Odoo includes Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, among others.

A good point to note is that Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

.tdi_2.td-a-rec{text-align:center}.tdi_2 .td-element-style{z-index:-1}.tdi_2.td-a-rec-img{text-align:left}.tdi_2.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_2.td-a-rec-img{text-align:center}}

For CentOS 7, check: How To Install Odoo 15 on CentOS 7

The next sections will cover the steps for installing Odoo15 on Ubuntu 20.04/18.04 Linux. We will begin with the standard OS updates, then into dependency package installations. We won’t build Odoo manually since Odoo15 ‘deb’ packages are available for Ubuntu.

Step 1: Update Ubuntu system

Start by updating your Ubuntu Linux.

sudo apt update && sudo apt -y upgrade

A reboot is necessary after an upgrade.

[ -f /var/run/reboot-required ] && sudo reboot -f

Step 2: Install PostgreSQL Database

Odoo recommends using PostgreSQL database server for data storage, install PostgreSQL database server on Ubuntu:

To install the default version available in Ubuntu repositories. run:

sudo apt install postgresql postgresql-client

Step 3: Install wkhtmltopdf

wkhtmltopdf is required for printing reports as it does the conversion of html to pdf. The version of wkhtmltopdf available in Ubuntu repositories does not support headers and footers so it is not used as a direct dependency.

The recommended version of wkhtmltopdf to install is 0.12.6 and is available on the wkhtmltopdf download page, in the archive section.

Step 4: Install Odoo15 on Ubuntu

Add Odoo deb repository so that you can install Odoo15 on Ubuntu 20.04|18.04.

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

Update Apt cache and install Odoo15 on Ubuntu 20.04|18.04.

sudo apt update
sudo apt install odoo

The service is started automatically after the installation of Odoo on Ubuntu 18.04 Linux.

$ 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 Sun 2023-05-03 20:09:17 UTC; 33s ago
Main PID: 9181 (odoo)
Tasks: 4 (limit: 2344)
Memory: 69.9M
CGroup: /system.slice/odoo.service
└─9181 /usr/bin/python3 /usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log
May 03 20:09:17 ubuntu20 systemd[1]: Started Odoo Open Source ERP and CRM.

Set the service to start on every system reboot.

$ sudo systemctl enable --now odoo
enabled

The service is started on port 8069. This can be confirmed using the command below.

$ 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

Install Nginx on your Ubuntu system,

sudo apt -y install nginx vim

There are two scenarios for Nginx proxy configuration – With HTTPS and when traffic is not served over secure connection. In this section, we’ll consider both setups.

Setup Nginx HTTP proxy for Odoo

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.geeksforgeeks.org;
    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.geeksforgeeks.org, 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

No error should be encountered on restart.

$ systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2023-10-19 17:34:39 UTC; 5s ago
     Docs: man:nginx(8)
  Process: 626 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 615 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 631 (nginx)
    Tasks: 2 (limit: 2362)
   CGroup: /system.slice/nginx.service
           ├─631 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           └─632 nginx: worker process
....

Step 6: Using Let’s Encrypt SSL Certificate for Odoo on Nginx (Optional)

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.

#Certbot installation
sudo apt update
sudo apt install certbot
sudo apt install python-certbot-nginx

#Configure Nginx with Let's Encrypt SSL
sudo systemctl stop nginx

export DOMAIN="erp.geeksforgeeks.org"
export EMAIL="[email protected]"
sudo certbot 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.geeksforgeeks.org/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/erp.geeksforgeeks.org/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/bin/certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"

Create Nginx configuration file.

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

Modify below and add to file.

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

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

server {
    listen 443 ssl;
    server_name erp.geeksforgeeks.org;
    access_log /var/log/nginx/odoo_access.log;
    error_log /var/log/nginx/odoo_error.log;
   
   # SSL
    ssl_certificate /etc/letsencrypt/live/erp.geeksforgeeks.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/erp.geeksforgeeks.org/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/erp.geeksforgeeks.org/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;
}

Don’t forget to substitute erp.geeksforgeeks.org with your domain name.

Restart Nginx.

sudo systemctl restart nginx

Step 7: Access Odoo Web interface

Access Odoo Web page on your domain name from a web browser.

install odoo ubuntu 18.04 01

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.

install odoo ubuntu 18.04 02

If you did configure https, the page should be loaded over a secure tunnel.

install odoo ubuntu 18.04 03

Visit Odoo documentation page for more reading.

Similar guides:

.tdi_4.td-a-rec{text-align:center}.tdi_4 .td-element-style{z-index:-1}.tdi_4.td-a-rec-img{text-align:left}.tdi_4.td-a-rec-img img{margin:0 auto 0 0}@media(max-width:767px){.tdi_4.td-a-rec-img{text-align:center}}

RELATED ARTICLES

Most Popular

Recent Comments