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 Image: 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)

 

A place for big ideas.

Reimagine organizational performance while delivering a delightful experience through optimized operations.


 

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. 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. If you require assistance, Zehntech experts can help you with any specific configuration or odoo customization needs. You can contact us at hello@zehntech.com for guidance and support related to your Odoo installation or any specific requirements you have.
 

Top Stories

Odoo project management module
Discover How the Odoo Project Management Module Boosts Productivity by 30%
Want to transform how you manage projects and boost your team's productivity? Imagine a tool that can increase your efficiency by a staggering 30%.  Understanding of Odoo Project Management Module We're about to reveal the Odoo Project Management module's magic in this article. Whether you're an experienced project manager or
Odoo
Customize Your Website Design with Odoo Drag & Drop Website Builder
Having an attractive and functional website is necessary for the success of businesses. A well-designed website attracts visitors and improves the user experience, furthermore, increases user engagement, and ultimately increases conversions. The Drag-and-Drop Builder of Odoo ERP is an effective application that enables businesses to create stunning, personalized websites. In
Odoo Marketing Tools
Odoo Marketing Tools to Drive Market Success
Marketing campaigns must be able to effectively reach their target audience in today's competitive environment. This can indeed be a challenging task at times, particularly for businesses with limited resources. However, the integrated marketing tools provided by Odoo ERP can assist businesses of all sizes in streamlining their marketing efforts
Modernize HR Operations with Odoo Human Resources
Modernize HR Operations: Unleash the Future of Human Resource with Odoo
According to today's business environment, organizations face numerous challenges when it comes to managing human resources tasks efficiently. HR departments are often burdened with time-consuming tasks, from recruitment, onboarding to performance evaluation and payroll management. Nowadays, traditional methods of HR management can be inefficient, error-prone, and, most importantly, need more
Odoo Website Builder
Create Professional Websites Using Odoo Website Builder
A professional and engaging presence is necessary for success in today's business environment. A well-designed website establishes your brand's credibility and increases customer trust by showcasing your products and services. Odoo ERP, According to Trends Built With's research, 66,810 live websites use Odoo, and an additional 39,778 sites have historically
Odoo ERP for Inventory Management
Unveiling 8 Vital Benefits of Odoo ERP for Inventory Management
In today's competitive business environment, the success of any company hinges on effective inventory management. As businesses grow and expand, inventory management becomes increasingly complex, leading to inefficiencies, errors, and financial losses. To tackle these challenges, Odoo ERP systems come into play, streamlining various business processes and ensuring seamless inventory

    Error: Contact form not found.

        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.