How to Install Odoo on Your Jotelulu Linux Server

In this tutorial, we’ll explain how to install Odoo on your Jotelulu Linux Server.

Odoo is a suite of open-source business apps that covers all things, including ERP, CRM, inventories, accounting, mailing, invoicing, etc.

It has everything you need to manage your customers, sales, etc. in a simple and sustainable way. So, today, we’re going to show you how you can install it on Ubuntu.

 

How to Install Odoo on a Linux Server

Before you get started…

To successfully complete this tutorial, you will need the following:

  • To be registered with an organisation on the Jotelulu platform and to have logged in.
  • To have registered for a Servers subscription.
  • An Ubuntu server deployed on your Servers subscription.
  • The server must have at least 2 CPUs.
  • A user account with administrator privileges or root access using the “sudo” command.

 

Part 1 – Installing Docker

NOTE: In this tutorial, we’re going to assume that you’ve already deployed Docker on your system. If you haven’t, we recommend that you check out this article where we explain how to do it.

 

Part 2 – Installing Docker Compose

Docker Compose is a tool for defining and running multi-container Docker applications and managing them more efficiently. YAML files are used to configure your applications services. This way, with just a single command, you can create and start all the services from your configuration.

To install Docker Compose on your Ubuntu server, you’ll first need to update the packages that your distro can use. Once you’ve done this, you can proceed to install Docker Compose using the “apt” command.

NOTE: You can run commands in one of two ways. If you have root access, you can simply run the commands from there, but if you don’t, you can use the “sudo” command which temporarily gives you privileged access to run the commands.

Therefore, the commands you need to run will be either:

# sudo apt update

# sudo apt install docker compose

or

# apt update

# apt install docker compose

Part 2 - Updating Ubuntu
Part 2 – Updating Ubuntu

Once the installation is complete, you can check that it has been successful by running the following command:

# docker compose –version

 

Part 3 – Installing Odoo and PostgreSQL Using Docker Compose

Now that Docker Compose is running on your server, it’s time to install Odoo. However, Odoo is also going to need a database in order to run properly, and we recommend PostgreSQL.

To do this, first create a directory called “Odoo” where you’ll store the Odoo and PostgreSQL containers and the files required for Odoo to run properly. To do this, run the “mkdir” command”.

# mkdir ~/odoo

# cd ~/odoo

Here, the “~” symbol represents the HOME directory. So, by entering “~/odoo”, this will create a directory at “$HOME/odoo”, where “$HOME” is the user that you’re using to carry out the installation.

Once you’ve created the Odoo directory, you need to create a blank YAML file called “docker-compose.yml” using your preferred editor. I prefer to work with Vi, but you can use Nano Emacs or whatever else you prefer:

# vi docker-compose.yml

or

# nano docker-compose.yml

Next, you need to edit the file that Docker Compose will use to launch and link the Odoo and PostgreSQL containers.

To edit the file in Vi, hit the “i” key (insert) and paste the following text:

version: ‘3’

services:

odoo:

image: odoo:15.0

env_file: .env

depends_on:

– postgres

ports:

– “127.0.0.1:8069:8069”

volumes:

– data:/var/lib/odoo

postgres:

image: postgres:13

env_file: .env

volumes:

– db:/var/lib/postgresql/data/pgdata

volumes:

data:

db:

Where you can see that we’re configuring two separate services:

  • Odoo: CRM/ERP.
  • Postgres: Database used by Odoo.

Odoo will use port 8069, so this will need to be open on your firewall.

The rest of the commands specify the location of the volumes or the environment variables that we’ll configure later using the “env_file” attribute.

NOTE: You could put everything in the “docker-compose.yml” file, but we recommend keeping everything separate, especially to avoid keeping passwords in the file.

Once you have made your changes, if you’re working in Vi, hit the ESC button and then type “:wq”, which will save (Write) the configuration and close the editor (Quit).

If you’re working in Nano, press Ctrl+O and hit Enter to save your changes. Then, press Ctrl+X to close the editor.

Next, you need to define the environment variables so that Odoo and PostgreSQL can be configured correctly.

To do this, you need to create a new “.env” file using your editor.

# vi .env

or

# nano .env

Next, in Vi, press the “i” key and paste the following text into the editor:

# postgresql: Environment Variables

POSTGRES_DB=postgres

POSTGRES_PASSWORD=<Postgres_Password>

POSTGRES_USER=odoo

PGDATA=/var/lib/postgresql/data/pgdata

# odoo: Environment Variables

HOST=postgres

USER=odoo

PASSWORD=<User_Password>

Where…

  • <Postgres_Password> should be your Postgres password.
  • <User_Password> should be your user password.

NOTE: If you don’t have a strong password policy, use the “openssl” command to generate a secure, random password.

Once you’ve finished editing, if you’re using Vi, hit the ESC key and type “:wq”. If you’re using Nano, press Ctrl+O and Enter to save. Then, press Ctrl+X to exit the editor.

At this point, you should be able to manage Odoo using Docker Compose. To do this, run the following command:

# docker-compose up -d

Where…

  • “up” runs the program.
  • “-d” runs the program in detached mode.

NOTE: This command may take a while to run, particularly if you’re running it for the first time.

Part 3 - Run Odoo using Docker Compose in detached mode
Part 3 – Run Odoo using Docker Compose in detached mode

Once messages have stopped appearing on the screen, if everything has worked correctly, Odoo will now be running.

The simplest way to check this is to use the “curl” command along with “127.0.0.1:8069”:

# curl –head http://127.0.0.1:8069

or

# curl –head http://localhost:8069

Where…

  • “head” indicates that we only want to see headers.

In this case, we want to see the message “HTTP/1.0 303 SEE OTHER” to show that Docker and Odoo are running.

 

Paso 4 -Installing Nginx

Now that we’ve installed Odoo, we’re going to improve performance by putting Nginx in front of it, which will take care of things like caching, compression and serving static files.

Once again, we’ll check that all packages are up to date using the “apt update” command.

# apt update

or

# sudo apt update

And once updated, we’ll run the installation command, “apt install nginx”.

# sudo apt install nginx

or

# apt install nginx

Part 4 - Installing Nginx
Part 4 – Installing Nginx

Next, run “ufw allow” in order to allow public traffic via ports 80 (HTTP) and 443 (HTTPS):

# ufw allow “Nginx Full”

or

# sudo ufw allow “Nginx Full”

Then, we need to edit a new file “/etc/nginx/sites-available/odoo.conf” in the Nginx configuration folder.

# nano /etc/nginx/sites-available/odoo.conf

or

# sudo nano /etc/nginx/sites-available/odoo.conf

Next, paste the following configuration:

server {

    listen       80;

    listen       [::]:80;

    server_name  <Domain_Name>;

    access_log  /var/log/nginx/odoo.access.log;

    error_log   /var/log/nginx/odoo.error.log;

    location / {

      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

      proxy_set_header X-Real-IP $remote_addr;

      proxy_set_header X-Forwarded-Host $host;

      proxy_set_header X-Forwarded-Proto https;

      proxy_pass http://localhost:8069;

  }

}

Where…

  • <Domain Name> should be the domain configured to point to the Odoo server, such as odoo.jotelulu.com.
  • Listen: At this point, it’s working with HTTP (Port 80). We’ll make this secure later.
  • “*_log” specifies where the log files are saved.
  • Proxy_* specifies the proxy settings.

Once again, if working with VI, kit the ESC key and type “:wq” to save your changes and exit the editor. If you’re working with Nano, press Ctrl+O and Enter and then, Ctrl+X to exit.

The next step is to create a link between the new file and the available sites:

# ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/sites-enabled/

or

# sudo ln -s /etc/nginx/sites-available/odoo.conf /etc/nginx/sites-enabled/

To check that everything has gone smoothly, run the test command on the Nginx file.

# nginx -t

or

# sudo nginx -t

Lastly, reload the Nginx configuration using the “systemctl” command.

# systemctl reload nginx.service

or

# sudo systemctl reload nginx.service

You can also check the status using the following command:

# systemctl status nginx.service

or

# sudo systemctl status nginx.service

Part 4 - Checking the status of Nginx
Part 4 – Checking the status of Nginx

You should now have access to the Odoo start screen, but it still needs to be fully configured.

Part 5 - Odoo start screen
Part 5 – Odoo start screen

 

Part 5 – Configuring Odoo

We’ve now reached the final step, configuring Odoo so that it’s ready to use. All you need to do is fill in the following fields on the Odoo start screen shown above:

  • Database Name, which in this case will be “Odoo”.
  • Email, which should be the administrator’s e-mail address.
  • Password.
  • Phone number, which should be the administrator’s phone number.
  • Language.
  • Country.
  • Demo data (leave this checked if this is the first time you’ve installed Odoo.

NOTE: You will use the e-mail address and password to access Odoo in the future. So, make sure you don’t lose or forget them.

Once you’ve filled in these details, simply click on Create database.

Part 5 - Odoo start screen with configuration data filled in
Part 5 – Odoo start screen with configuration data filled in

It may take a few minutes to create the database tables and prepare the environment. Once this is finished, you’ll be redirected to the Odoo Apps management page.

All that remains now is to sign into the platform and start entering in usernames, passwords and other related details.

NOTE: You will also need to configure certificates for a secure connection when using Odoo.

 

Summary

As you can see, installing Odoo using Dockers on Ubuntu Linux is a relatively simple task once you know the steps to follow. In this tutorial, we assumed that you had already installed Docker on your Linux server. But if you haven’t done so, visit our blog to find instructions on how to do it. We’ll be back with more tutorials about Odoo soon.

Thanks for reading!

Categories:Servers

Fill out the form and one of our Sales team will contact you soon.

growth@jotelulu.com  |  jotelulu.com 

You can unsubscribe from these communications at any time. For more information,  check our Privacy Policy.

 

We make the difficult easy

Existing Disaster Recovery tools often require advanced knowledge to manage, demanding expertise that is difficult to acquire.

Jotelulu’s Disaster Recovery aims to make the difficult easy and offers a very simple deployment based on a three-step configuration:

Origin (Primary Site)
Determine the origin location of the subscription on which the Disaster Recovery service will be established.

Destination (Recovery Site)
Set the destination location (availability zone) where you want the Recovery Site to be deployed.

Replication characteristics
Specify the data related to the number of copies to be kept and the frequency at which the replication will be performed.