How to Deploy Odoo 16 Community in Docker

In this tutorial we are going to deploy Odoo 16 Community in docker using odoo 16 docker-compose. But before we delving into it, some of you may not know what Docker is so let’s try to cover the most basic by knowing it first.

What is Docker?

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Container is a place where your apps or software runs, and each container that runs is not going to affect each other. That means, every app you run in each container will be separated into different environment.

Docker Illustration

As you can see in the image above, Docker has to be installed in your operating system first. After that, you can later run your container environment on the top of your docker. There’s so much app that you can run on Docker, and in this case we are going to discuss regarding Odoo Version 16.0 Deployment.

With Docker, we can later create many container with different major version. We will be able to install version 15.0, 14.0, or more which runs in the same machine. This tutorial will cover Docker installation using Linux Debian based, which also similar to Ubuntu or also Mint Linux.

How To Install Odoo 16 Community in Docker?

Step 1 : Install Docker

First of all, log into your Linux machine as root for flexibility of installation by typing : 

sudo -i

After that, update the list of the apps by typing the command below to run update and upgrade it after the update is done

apt-get update && upgrade

This should take some time. After that, type the command below to install docker

apt-get install docker-compose

Wait until the screen is completely done installing. You can start docker by typing instruction below

systemctl start docker    
systemctl enable docker

To check the status of docker, you can type in :

systemctl status docker

Now, docker is completely installed in the machine. We can later proceed to prepare the Odoo

Step 2 : Install Odoo

Before we begin to deploy Odoo into our new fresh container, we need to set up some requirement to begin with. Odoo will need a real location (folder) inside our operating system to place the third party apps. Other than that, it is also needs a folder to keep the config files. 

In order to achieve that, in this scenario we are going to use linux /home/administrator folder to settle things up. Here, let’s enter that folder by typing in : 

 cd /home/administrator/Documents


After that, create a folder called odoo16 by typing : 

mkdir odoo16

Get into that newly created directory by typing :

cd odoo16

Create a docker-compose.yml which later will be used to initially deploy Odoo container. Docker Compose in general can be mentioned as a “blueprint” of a container. This compose file contains text that keep all of the properties of the container. We can create docker-compose file by typing :

touch docker-compose.yml


After that, we also need to create a new folder that will be used to save odoo.conf (Odoo config file) and the third party addons by typing : 

mkdir ./config && touch config/odoo.conf    
mkdir ./addons

Get into the docker-compose file which we already created by typing :

nano docker-compose.yml

After that, put the code below into it by copy-pasting. You can read some of the comments here and try to fiddle with it, like changing ports, etc.

Inside the config file, get into the odoo.conf file and add these configuration file

Final step, type these command below. This should start to run the docker-compose (blueprint) to build up the container for you :

docker-compose up

Wait until the progress is done. Now, to be able to access it locally you need to type in 127.0.0.1:8016 or based on your configured port. In order to add your third-party apps, you can copy-paste it into the addons folder which we already created earlier.


Leave a Reply

Your email address will not be published. Required fields are marked *