Web Hosting

How to install Odoo 14 on Ubuntu 20.04


In this tutorial we will show you how to install Odoo 14 (Community Edition) on an Ubuntu 20.04 server with Nginx as a reverse proxy and HTTPS via a free SSL certificate (Let’s Encrypt).

The instructions are the same for other versions of Ubuntu as well.

Step 1: get a server for Odoo

The first is the first – you need a server. We recommend purchasing a server from SolaDrive. They specialize in Odoo hosting and offer fully managed support for your server as well as some support for Odoo itself. You can install Odoo for you for free if you can get a server from them.

Alternatively, if you manage a server yourself and you know what you’re doing, you can get an unmanaged server from Vultr.

You can find more options on this page. Get a server with at least 2GB of RAM. The more the better.

If you want to use Odoo locally, you don’t need a server and you can just proceed to the next step.

Step 2: Log in as root and update the server

Next, log into the server and update it before starting the actual Odoo installation:

apt-get update && apt-get upgrade

If the server you are using is unmanaged, you should properly configure and secure the server. Make sure you keep it up to date and keep backups. If you’ve got a server from SolaDrive, it’s fully managed so it does most of the work for you.

Step 3: Install PostgreSQL and other packages

Odoo requires PostgreSQL. Run the following command to install it and some other packages we will need for this tutorial:

apt-get install postgresql nano wget

Step 4: Install Odoo

We will be using the nightly packaged installer for Odoo. Run the following commands:

wget -O – https://nightly.odoo.com/odoo.key | apt-key add – echo “deb http://nightly.odoo.com/14.0/nightly/deb/ ./” >> /etc/apt/sources.list.d/odoo.list apt-get update && apt- Get install Odoo

This will add the repository and install the community edition of Odoo with all its dependencies.

Step 5: Start Odoo and activate it on boot

If you’ve run the package installer, Odoo may already be running. You can check the status by running this command:

systemctl status odoo

If it’s not running, you can start it with the following command:

systemctl start odoo

Run the following command to allow Odoo to start on boot:

systemctl enable odoo

Step 6: Finish the Odoo installation

To complete the installation you need to create a database and do the final step by looking at your server’s IP address on port 8069. This is the standard port for Odoo.

So visit http: // yourserversip: 8069

and fill in the details, everything is self explanatory. In this step a database is created that you can optionally fill with demo data.

Once this step is complete, you can use Odoo and install apps.

If you want to use a domain name instead of your server’s IP address, you’ll need to set up a reverse proxy.

(Optional) Step 7: Set up Nginx as a reverse proxy with HTTPS (Let’s Encrypt).

First, install nginx and certbot with the following command:

apt-get install nginx python3-certbot-nginx

Then start the Nginx service if it has not already started and enable it at boot:

systemctl start nginx systemctl enable nginx

Next, edit the Odoo configuration file

nano /etc/odoo/odoo.conf

and set proxy_mode to True (by default it is set to False):

proxy_mode = True

Then create a Nginx configuration file for Odoo:

nano /etc/nginx/conf.d/odoo.conf

And add the following:

Upstream odoo {server; } server {listen 80; Server name odoo.thishosting.rocks; root / usr / share / nginx / html; index index.html index.htm; access_log /var/log/nginx/odoo-odoo.thishosting.rocks-local.access.log; error_log /var/log/nginx/odoo-odoo.thishosting.rocks-local.error.log; location / {proxy_pass http: // odoo; # Force timeouts if the backend dies proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; # set headers 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 https; } # Caching some static data in memory for 60 minutes Storage location ~ * / web / static / {proxy_cache_valid 200 60m; proxy_buffering on; expires 864000; proxy_pass http: // odoo; }}

Make sure to replace “odoo.thishosting.rocks” with your own domain name.

To test the configuration file, do the following:

nginx -t

If everything is fine, just restart Nginx and use your domain:

restart systemctl nginx

You can stop here if you don’t need SSL (HTTPS).

To install a free Let’s Encrypt SSL for your domain, do the following:

certbot –nginx -d odoo.thishosting.rocks

Use your own domain name instead of “odoo.thishosting.rocks” of course.

Follow the self-explanatory instructions. Make sure that certbot sets up the redirection from http to https (option 2).

If you are using a firewall, make sure you allow the ports for https with the following commands:

ufw allow ‘Nginx Full’ ufw reload

And that’s it. Now you can use Odoo at https://odoo.thishosting.rocks or whatever your domain name is.

How do I update Odoo on Ubuntu?

When a newer version of Odoo has been released, you can upgrade to it on the same server you are currently using. In short, just follow this installation tutorial one more time, but for the newer version. Make sure you don’t delete the old database.


Jeffrey Rabinowitz