How to install Odoo 13 or 14 on Docker Container

There is a couple of well-known open-source business management software and Odoo is one of them. It offers ERP, CRM, ECM, project planning, and more…  In this article, we learn how to install Odoo 14 and 13 on a docker container running on Ubuntu 20.04 LTS Focal fossa.

Odoo is free business software that covers a wide range of tasks. In addition to classic ERP functions, the environment offers CRM, E-commerce, content management, project planning, warehouse management, accounting, personnel management, portal, knowledge base, product management, human resources, marketing, and more.

The basis of Odoo is the former OpenERP, which is based on a typical three-tier architecture. The core is the application server, which is responsible for the business logic and controls access to the database.

The system also provides modules for the areas of e-business, e-marketing, and e-commerce. There are over 10,000 Odoo Apps- and the number is increasing every day.  It is programmed in Python and offers a modern web interface that uses HTML 5.0 and JavaScript. It uses a PostgreSQL database server to manage business-relevant data and the system configuration.

Whereas Docker is a container-based virtualization platform that can be installed on a popular operating system to create isolated containers (virtual machines), very light in weight.

Steps to install Odoo 13/14 on Docker Container

Here we are using Ubuntu 20.04 LTS as an OS platform to install Docker, however, the steps given here to install Odoo can be used on any platform running with Docker.

1. Check Docker is running

Simply run a command – docker on your operating system’s command terminal, to confirm you have it. If you don’t have it, then install Docker on your OS, first, for that you can check out our tutorials-

 

2. Install Odoo Docker Image

Well. once you have Docker on your system, to install Odoo Container, we just need to run a single command. It is because the Docker hub already has a pre-built official image of Odoo.

To install Odoo 14, use this command:

docker pull odoo:14

For Oddo 13, use this one:

docker pull odoo:13

 

3. Install PostgreSQL Database Docker Image

The next thing we need to set up is the database for Odoo to save its data on Docker. Well, just like any other popular app, we already have a pre-built image for this database as well. Hence, just on your command terminal type-

docker pull postgres

Docker PostgreSQL and Odoo Images command

 

4. Create Database Container

Well, we already have downloaded the PostgreSQL image above, now we will use the same to create a container with a database.

docker run -d -v odoo-db:/var/lib/postgresql/data -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres

Note: Don’t forget to change the database user and password including DB name with the one you want to assign before running the command.

Explanation: 

Let’s break the above command to understand what is happening.

docker run -d -v: This is a docker command to create and start the container using the downloaded image.

odoo-db:/var/lib/postgresql/data – Using this we have created a dedicated separate folder that will store the database data. This means even after removing the container, our Odoo data will remain intact for future usage.

POSTGRES_USER=odoo – A User created for database, change the value with whatever you want.

POSTGRES_PASSWORD=odo0 – Password for the created database user. Also, change this value as well to set your password.

POSTGRES_DB=postgres – It is the Database name you want to use.

--name db – Container name to identify it.

postgres – It is the name of the downloaded PostgreSQL image we are using to create the container.

 

6. Create and Run Odoo Container

Just like we did for PostgreSQL, we also use the downloaded Odoo 14 or 13 image to create and run a container for it.

For Odoo version 14

docker run -v odoo-data:/var/lib/odoo -d -p 8069:8069 --name odoo --link db:db -t odoo:14

For Odoo Version 13

docker run -v odoo-data:/var/lib/odoo -d -p 8069:8069 --name odoo --link db:db -t odoo:13

Explanation:

odoo-data:/var/lib/odoo: We have created a dedicated persistent data folder that will store Odoo data and configuration files and will remain there even after deleting the container.

-p 8069:8069: Opening Port 8069 of docker to access the Odoo web interface out of the docker.  Or in simple words here we are mapping the docker container port to the system’s 8069 port.

--name odoo – It is the name we are giving to our container.

--link db:db – Linking PostgreSQL container with the Odoo one, so that they can communicate.

Whereas odoo:13 or odoo:14 are the Docker image we are using to create a container.

 

7. Open Port in firewall

Now, to access the Odoo Web interface from outside the server where you have installed it using the docker, we have to open its port 8069 on the system.

For Ubuntu, Debian, Linux Mint, and others similar:

sudo ufw allow 8069

For RHEL, CentOS, AlmaLinux, RockyLinux, Oracle:

firewall-cmd --zone=public --add-port=8069/tcp --permanent
firewall-cmd --reload

 

8. Access Odoo Web interface and Create Database

Now, go to any PC or Laptop that can access the Server ip-address where you have installed the Docker and its container. After that, open the browser and point it to the server-ip-address along with port number 8069.

Example:

http://192.168.0.102:8069

Enter the required information and create a database

Create Odoo Database

Install Apps and start using on Odoo.

Odoo Apps install on Docker container CRM adn ERP

 

 

2 thoughts on “How to install Odoo 13 or 14 on Docker Container”

    • 1. Put your custom add-on under the addons path.
      2. Goto settings -> Activate Developer Mode.
      3. Goto Apps -> Update Apps list
      4. This gives a wizard.
      5. Click on Update, After that search for your custom app and install.

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.