Odoo is one of the most powerful open-source ERP platforms that is used by almost all businesses, from CRM to inventory to accounting and eCommerce. However, managing Odoo manually is a super complex and time consuming task, especially when you are dealing with dependencies and system configurations.
Docker simplifies the entire process by packaging Odoo and its environment into isolated containers that are super easy to deploy, replicate, and manage. When you are a developer testing Odoo locally or a business looking for a scalable deployment solution, running Odoo on Docker offers a fast, flexible, and consistent setup.
In this guide, you can learn how to run Odoo on Docker step by step and explore configurations.
Why Use Docker for Odoo?
Running Odoo on Docker streamlines the installation and management process by packaging Odoo and its dependencies into a containerized environment. Instead of manually setting the configurations for PostgreSQL, Python packages, and system libraries, Docker allows you to deploy Odoo with a consistent setup across development, staging, and production.
Other benefits include:
- Quick deployment with very little configuration.
- Environmental isolation to avoid conflicts with other software.
- Scalability for larger Odoo instances.
- Easy updates and backups for using the container snapshots.
- Portability across the machines, teams, and cloud platforms.
Prerequisites for Running Odoo on Docker
Before you start running Odoo on Docker, make sure that your system meets the following requirements:
Get exclusive access to all things tech-savvy, and be the first to receive
the latest updates directly in your inbox.
- A system that already has Docker installed.
- Docker Compose installed
- Basic command-line knowledge
- A stable internet connection to pull Docker images
Setting Up Odoo Docker Container: Step-by-Step
You can run Odoo on Docker in two primary ways, using the official Docker image or with Docker Compose. Here is a quick
You can run Odoo with Docker in two main ways: using the official Docker image (simple use case) or with Docker Compose (for full Odoo + PostgreSQL setup). Here’s a quick walkthrough:
Using Official Odoo Docker Image
- Pull the official Docker image using: docker pull odoo:latest
- Run a PostgreSQL container (Odoo needs this):
docker run -d \
–name db \
-e POSTGRES_USER=odoo \
-e POSTGRES_PASSWORD=odoo \
-e POSTGRES_DB=postgres \
Postgres:13
- Run the Odoo container and link it to PostgreSQL:
docker run -d \
–name odoo \

-p 8069:8069 \
–link db:db \
-t odoo:latest
- Access your Odoo instance using your browser and go to http://localhost:8069
Creating a Custom Odoo Docker Compose File
Alternatively, you can use Docker Compose to easily manage multi-container setups like Odoo and PostgreSQL, define the environment variables, and persist data across restarts.
Here’s a sample docker-compose.yml file:
version: ‘3.1’
services:
web:
image: odoo:latest
depends_on:
– db
ports:
– “8069:8069”
environment:
– HOST=db
– USER=odoo
– PASSWORD=odoo
volumes:
– odoo-web-data:/var/lib/odoo
– ./addons:/mnt/extra-addons
db:
image: postgres:13
environment:
– POSTGRES_DB=postgres
– POSTGRES_USER=odoo
– POSTGRES_PASSWORD=odoo
volumes:
– odoo-db-data:/var/lib/postgresql/data
volumes:
odoo-web-data:
odoo-db-data:
- Save the file in the example above as docker-compose.yml.
- Then run the containers using docker-compose up -d
- Open http://localhost:8069 to access Odoo.
Persistent Storage and Data Volumes in Odoo Docker
Docker containers are ephemeral by default, meaning any data that is stored inside a container is lost permanently when the container is removed. For Odoo, this essentially means that your database records and custom modules would be removed without any persistent storage.
To keep the data between restarts or rebuilds, Docker volumes are used:
- PostgreSQL Data: Stored in a volume mapped to /var/lib/postgresql/data
- Odoo Filestore & Config: Stored in /var/lib/odoo
- Custom Addons: Can be mounted to /mnt/extra-addons
Example from docker-compose.yml:
volumes:
odoo-web-data:
odoo-db-data:
Docker volumes ensure that no data is lost, along with seamless upgrades or container recreation. It would also help facilitate the backup and migration of your Odoo setup.
Accessing and Managing the Odoo Instance
Once the containers are up and running, managing Odoo instances on Docker is super straightforward.
Access via Web Interface:
- Open your browser and go to http://localhost:8069
- Then complete the initial setup by creating a database, admin user, and install the required apps.
Accessing Containers:
- To run shell commands or debug:
docker exec -it odoo bash
- To check logs:
docker logs odoo
- To restart services:
docker-compose restart
Odoo Docker Container Best Practices
Here are some of the best practices that you should follow to maintain a stable, secure, and efficient Odoo environment on Docker.
- Use Docker volumes for persistent data
- Mount custom modules using bind mounts for easy development
- Keep the containers updated by rebuilding them with new image versions.
- Limit the container permissions using the non-root users wherever possible.
- Use Docker networks for secure communication between the containers.
- Backup the Odoo filestore and PostgreSQL volumes.
- Regularly monitor container performance using the Docker stats or external tools like Portainer.
Common Issues and How to Troubleshoot
Issue | Cause | Solution |
Odoo cannot connect to DB | Misconfigured DB host or env vars | Ensure HOST=db and depends_on: db are set |
Port 8069 already in use | Another app is using the port | Change port in Docker Compose to – “8070:8069” |
Addons not loading | Incorrect mount or path | Check if ./addons:/mnt/extra-addons exists and has modules |
Data lost after restart | No persistent volume | Define named volumes in docker-compose.yml |
Slow performance | Insufficient system resources | Increase Docker memory/CPU allocation |
Cannot access UI | Firewall, port block, or crash | Check logs via docker logs odoo |
Conclusion: Is Docker the Best Way to Run Odoo?
Running Odoo on Docker is a modern and efficient way to manage the ERP deployments, no matter if you are a solo developer or running production workloads. It offers high flexibility, quick setup, isolation, and reproducibility. With the help of Docker Compose, even complex Odoo setups become easy to manage and maintain.
FAQs
Does Odoo have an official Docker image?
Yes, Odoo provides an official Docker image that simplifies deployment and includes support for PostgreSQL integration.
Can I persist data when using Odoo with Docker?
Yes, you can mount volumes to persist both Odoo and PostgreSQL data even after container restarts.
How do I access Odoo once the Docker container is running?
You can access Odoo via your browser using the mapped host port, typically http://localhost:8069
or your server IP.