Odoo Docker ComposeGenerator
Generate a production-ready docker-compose.yml for Odoo in seconds. Choose a template, customize your stack, and download.
What is Docker Compose for Odoo?
Docker Compose lets you define your entire Odoo stack — app server, database, reverse proxy, and tools — in a single YAML file. One command (docker compose up -d) spins up everything. This generator creates that file for you with production best practices built in.
| Setup Type | Services | Workers | Reverse Proxy | SSL |
|---|---|---|---|---|
| Development | Odoo + PostgreSQL + pgAdmin | 0 (single-process) | None | No |
| Production | Odoo + PostgreSQL + Traefik | 2-4 | Traefik | Let's Encrypt |
| High Availability | Odoo + PostgreSQL + Traefik | 4+ | Traefik | Let's Encrypt |
Select a template below and customize to match your requirements. The generated file follows Odoo Docker deployment best practices.
Choose Template
Odoo Configuration
0 = single-process mode (dev only)
Mount a local addons directory
PostgreSQL Database
Generated password (save this!):
uyMs7xETrPGO9KUHAT6jhJkaReverse Proxy & SSL
Auto-provision HTTPS certificates
Advanced Options
Services
Resource Limits
Docker Settings
# Generated by OEC.sh Docker Compose Generator
# https://oec.sh/tools/docker-compose-generator
# Template: production | Odoo 19.0 community
#
# Secrets are in the .env file (auto-read by Docker Compose).
# NEVER commit the .env file to version control.
#
# Usage:
# docker compose up -d
# docker compose logs -f odoo
#
services:
odoo:
image: "odoo:19.0"
container_name: odoo
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
HOST: db
PORT: "5432"
USER: "${POSTGRES_USER}"
PASSWORD: "${POSTGRES_PASSWORD}"
volumes:
- "odoo-data:/var/lib/odoo"
networks:
- odoo-net
ports: []
command: "--workers=2 --max-cron-threads=1 --gevent-port=8072 --proxy-mode --database=odoo --admin-passwd=${ODOO_ADMIN_PASSWORD}"
labels:
- traefik.enable=true
- "traefik.http.routers.odoo.rule=Host(`odoo.example.com`)"
- traefik.http.services.odoo.loadbalancer.server.port=8069
- traefik.http.routers.odoo.entrypoints=websecure
- traefik.http.routers.odoo.tls.certresolver=letsencrypt
- "traefik.http.routers.odoo-longpolling.rule=Host(`odoo.example.com`) && PathPrefix(`/longpolling`)"
- traefik.http.routers.odoo-longpolling.service=odoo-longpolling
- traefik.http.services.odoo-longpolling.loadbalancer.server.port=8072
- traefik.http.routers.odoo-longpolling.entrypoints=websecure
- traefik.http.routers.odoo-longpolling.tls.certresolver=letsencrypt
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
healthcheck:
test: "[\"CMD\", \"curl\", \"-f\", \"http://localhost:8069/web/health\"]"
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
deploy:
resources:
limits:
cpus: "1"
memory: 2048M
db:
image: "postgres:16-alpine"
container_name: db
restart: unless-stopped
environment:
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
volumes:
- "postgres-data:/var/lib/postgresql/data"
networks:
- odoo-net
healthcheck:
test: "[\"CMD-SHELL\", \"pg_isready -U $POSTGRES_USER -d $POSTGRES_DB\"]"
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
logging:
driver: json-file
options:
max-size: 10m
max-file: "3"
traefik:
image: "traefik:v3.2"
container_name: traefik
restart: unless-stopped
ports:
- "\"80:80\""
- "\"443:443\""
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "traefik-certs:/letsencrypt"
networks:
- odoo-net
command: "--providers.docker=true --providers.docker.exposedbydefault=false --entrypoints.web.address=:80 --entrypoints.websecure.address=:443 --entrypoints.web.http.redirections.entrypoint.to=websecure --certificatesresolvers.letsencrypt.acme.email=admin@example.com --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json --certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
volumes:
odoo-data: null
postgres-data: null
traefik-certs: null
networks:
odoo-net:
driver: bridgeHow It Works
Choose a Template
Start with Development, Production, or High Availability. Each template pre-configures sensible defaults for its use case.
Customize Your Stack
Configure Odoo version, PostgreSQL, reverse proxy, SSL, workers, and advanced options. See the YAML update in real time.
Copy & Deploy
Copy the YAML to clipboard, download as a file, or share a URL. Then run docker compose up -d on your server.
Frequently Asked Questions
Common questions about running Odoo with Docker Compose.
What is the best Docker Compose setup for Odoo?
How many workers should I configure for Odoo in Docker?
Should I use Traefik or Nginx as a reverse proxy for Odoo?
How do I enable SSL/HTTPS for Odoo with Docker?
What PostgreSQL version works best with Odoo 19?
How do I add custom Odoo modules in Docker?
What are the minimum system requirements for Odoo in Docker?
How do I backup my Odoo Docker deployment?
Related Resources
More tools and guides for your Odoo deployment.
Ready to Deploy Your Odoo?
OEC.sh automates Odoo deployment on any cloud provider. Use the generated Docker Compose file with our platform for one-click deployments, monitoring, and backups.