
Launch Odoo 18 Like a Pro with Docker Compose
- Taral Desai
- Technology , Data
- April 4, 2022
Table of Contents
Ever wanted to try out Odoo 18 without diving into dependency hell? You’re in the right place. With Docker Compose, weβll spin up a full Odoo environment β clean, fast, and production-ready in minutes.
β‘ This guide is for makers, hackers, developers, and small business heroes who just want to get things running β with no fluff.
π§° Prerequisites
Before we dive in, make sure youβve got Docker and Docker Compose installed:
If youβre set, letβs roll!
π Project Structure
Hereβs how your setup will look:
odoo-docker-setup/
βββ docker-compose.yml
βββ odoo_pg_pass # PostgreSQL password (securely stored)
βββ config/
β βββ odoo.conf # Odoo configuration file
βββ addons/ # Your custom addons
π§Ύ docker-compose.yml
services:
web:
image: odoo:18.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
environment:
- PASSWORD_FILE=/run/secrets/postgresql_password
secrets:
- postgresql_password
db:
image: postgres:15
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
secrets:
- postgresql_password
volumes:
odoo-web-data:
odoo-db-data:
secrets:
postgresql_password:
file: odoo_pg_pass
ποΈ Odoo Configuration: odoo.conf
- Tab 1
- Tab 2
To customize your Odoo instance, create a configuration file at config/odoo.conf
with the following content:
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = admin
This tells Odoo where to look for extra modules (/mnt/extra-addons
), where to store persistent data (/var/lib/odoo
), and sets the master admin password (admin
).
Odoo automatically loads /etc/odoo/odoo.conf
when it starts, and our volume mapping (./config:/etc/odoo
) ensures this file is picked up.
π§Ύ Full Template for odoo.conf
Hereβs a more complete sample configuration file with optional parameters:
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
; admin_passwd = admin
; csv_internal_sep = ,
; db_maxconn = 64
; db_name = False
; db_template = template1
; dbfilter = .*
; debug_mode = False
; email_from = False
; limit_memory_hard = 2684354560
; limit_memory_soft = 2147483648
; limit_request = 8192
; limit_time_cpu = 60
; limit_time_real = 120
; list_db = True
; log_db = False
; log_handler = [':INFO']
; log_level = info
; logfile = None
; longpolling_port = 8072
; max_cron_threads = 2
; osv_memory_age_limit = 1.0
; osv_memory_count_limit = False
; smtp_password = False
; smtp_port = 25
; smtp_server = localhost
; smtp_ssl = False
; smtp_user = False
; workers = 0
; xmlrpc = True
; xmlrpc_interface =
; xmlrpc_port = 8069
; xmlrpcs = True
; xmlrpcs_interface =
; xmlrpcs_port = 8071
Uncomment and adjust the settings you need. This gives you fine-grained control over memory usage, logging, multi-worker setup, email, and more.
π Secure Your Secrets
Create your secret password file like this:
echo "supersecurepassword" > odoo_pg_pass
Keep this file out of version control (.gitignore
it!).
π Launch Time
From your project root, run:
docker compose up -d
π Visit http://localhost:8069 β your Odoo instance is live!
Create a new database, choose a password, and start exploring Odooβs powerful features.
π§½ Tidy Up
To stop your environment:
docker compose down
To also remove persistent volumes (β οΈ this deletes your data):
docker compose down -v
π¦ About Volumes
We use Docker volumes to persist important data:
odoo-web-data
: stores Odoo’s database files, attachments, and session info.odoo-db-data
: stores PostgreSQL data files.
These volumes ensure your data survives container restarts or upgrades.
If you want to back them up, you can use:
docker run --rm -v odoo-web-data:/data busybox tar czf - /data > odoo-web-data-backup.tar.gz
π Resources
π‘ Pro Tips
- Add custom modules in
addons/
- You can tweak startup behavior with command overrides
- Use environment files (
.env
) for large configs
Give it a spin and unleash the power of Odoo β with zero install pain. π