Automate Marketing Initiatives with Salesforce Marketing Cloud Learn More

How to Configure Odoo Using Docker Compose in Just 15 mins?

Everyone wants to install software easily and quickly. Consequently, nobody wants to get trapped in installing software due to dependency issues or others that may cause the installation process to fail. Similarly, there are numerous issues with Odoo installation.

Therefore we utilize Docker to deploy applications to address such issues. Further users can run Odoo instances in any environment without worrying about dependencies, setups, or other issues.

We’ll learn how to install Odoo using Docker Compose in this article.

Docker

Docker is an open-source platform as a service (PaaS) that allows you to build, deploy, and operate programs in separate containers. Therefore enables us to install and run software without having to worry about the machine’s configuration or dependencies. 

Docker Images

Furthermore, a Docker Image is a file that contains instructions for building and operating containers on the Docker platform. To put it another way, it’s a snapshot of a file system.

Docker Hub

Docker Hub is a cloud-based registry where we can store images. It is used to store and distribute images.

To deploy Odoo, we will be using the official Odoo and the Postgres Docker Image. Both are available on Docker Hub to use.

Postgres image: As we all know, Odoo uses Postgres as a database to store and manipulate data.  Postgres images are available on Docker Hub.

Odoo Image: There is an official Odoo image available on the Docker hub that can be used to install and run Odoo.

Docker Compose

Docker Compose is a tool for defining and running multi-container Docker applications. Meanwhile, it manages our web application. YML files are used by it to configure application services. It can extend selected services as needed. All services can be started or stopped with a single command.

Further Docker Compose is already available in Docker Desktop on Windows. Therefore there is no need to install Compose separately for Windows users.

To deploy Odoo, we will use Docker-editor. In Odoo it needs Odoo and Postgres. We create a docker-compose file and include both Odoo and Postgres containers. We can start and stop both containers with one command.

How to Use Docker-Compose to Run Odoo?

Firstly, you need to create a directory for the project:

  1. Keep your custom-addons/extra-addons inside this directory.
  2. Create a YML file for docker-compose (say docker_compose.yml)

Write instructions into the Docker-Compose file.

version: “3.1”

services:
db:
     image: postgres:latest
     restart: always
     ports:
       - 5444:5432
    environment:
        POSTGRES_USER: odoo
        POSTGRES_PASSWORD: odoo
   volumes:
       - pg-odoo: /var/lib/postgresql/data
 
odoo:
    image: odoo:latest
    ports:
        - 8069:8069
    environment: 
           -  HOST=db
           -  PORT=5432
           -  USER=odoo
           -  PASSWORD=odoo
  volumes:
       - ./extra-addons:/mnt/extra-addons
       - data:/var/lib/odoo
  depends_on:
          - db
volumes:
    pg-odoo:
    data:

This YML file includes two services. The first is DB, which is used to run the PostgreSQL container on port 5444. The second is Odoo, which runs the Odoo container on port 8069.

Odoo and PostgreSQL containers use environment variables to configure themselves, like POSTGRES_PASSWARD, HOST, USER, etc.

To add custom addons/extra-addons, create a custom directory and include mount this custom directory as written in the odoo service:

–  ./extra-addons:/mnt/extra-addons

We create two volumes for both services to store container data and be able to retrieve this data at any time in the future. There is a depend_on in Odoo services that specifies that the Odoo service depends on another service. In this, the first DB service is running, then the Odoo service.

Therefore, after completing all the necessary steps, we run the docker-compose command to run the YML file:

docker-compose -f <YML file name> up

Now, we can access it from http://localhost:8069

Furthermore, after accessing localhost on a certain port, get the above form to configure the database. We fill in this form with things like database name, master password for database email, password, etc.

Install the application from the application list and launch Odoo according to your needs.

Conclusion

Configuring Odoo via Docker makes installing the Odoo instance very smooth and easy. You don’t have to worry about dependencies, libraries, and configuration. We can easily run Odoo in any environment.

Manoj_J

Author

Share On

Let’s
Work
Together

Manoj_J

Manoj_J

Top Stories

Zabbix Vs Nagios
Zabbix vs Nagios Core – All Key Features & Functionalities Compared
Choosing an efficient IT infrastructure monitoring system for your business can be overwhelming, as you need to take many features, factors, and functionalities into consideration. Technical and business requirements need to be assessed, in addition to examining any anomalies in the deployment or support processes. The level of competence of
Implementing a Raspberry Pi and Arduino UNO Based Current/Voltage Measurement System
In this article, we show you how to measure the AC Current and AC Voltage using the ACS712 current sensor and ZMPT101B voltage sensor. In addition to the Wattmeter, this circuit also acts as a Voltmeter and Ammeter which are used to measure voltage and current, respectively. If the connection
Zabbix 6.2
Zabbix 6.2 - More Powerful, Featureful, & Secure
The focus of infrastructure monitoring software company Zabbix has always been on innovation. Over the past 6 versions, the software company has made some necessary big and minor changes in its front end and back end to enhance usability and overall user experience.   Just like the previous versions, Zabbix
Zabbix 6.0 LTS
Zabbix 6.0 LTS – All the Latest Features & Functionalities 
Zabbix is a robust network, virtual machine, cloud service, and server monitoring software built on an open-source environment. The monitoring tool which already has numerous benefits has launched a number of new features and functionalities with its latest version Zabbix 6.0 LTS. The latest version of the network monitoring tool
Salesforce Marketing Cloud
Automate Marketing Initiatives with Salesforce Marketing Cloud 
In today’s era of digitalization, it is imperative to leverage the power of automation in marketing to boost revenue and enhance overall customer satisfaction. In a survey published by Statista, digital marketing automation was found to be the second most effective digital marketing technique (after content marketing) [1]. In fact,
Things You Should Know About Odoo
Things you Need to Know About Odoo ERP System 
Are you considering Odoo as your next ERP system? If yes, this might have raised a few common questions in your mind. Why go for the Odoo ERP system? What benefits does Odoo ERP Offer? Is there a better ERP other than Odoo? Is Odoo customizable? To answer all these

        Success!!

        Keep an eye on your inbox for the PDF, it's on its way!

        If you don't see it in your inbox, don't forget to give your junk folder a quick peek. Just in case. 



            You have successfully subscribed to the newsletter

            There was an error while trying to send your request. Please try again.

            Zehntech will use the information you provide on this form to be in touch with you and to provide updates and marketing.