This content originally appeared on DEV Community and was authored by Treekon Ventures
As a developer working with ERP systems, I've found that setting up Odoo environments efficiently can save countless hours and prevent frustrating configuration issues.
Why I Created This Docker Setup for Odoo 18
Odoo is a powerful open-source ERP platform, but setting it up manually can be time-consuming and error-prone, especially when you're just trying to get started or move fast in development.
Recently, I built a lightweight Odoo 18 environment using Docker Compose. Here's why this approach works so well and how you can implement it in your own projects.
⚙️ Why Docker Compose?
✅ Zero local dependencies - No need to install PostgreSQL or Odoo separately
✅ Single command launch - Get your environment running with one simple command
✅ Environment consistency - Ensure identical setups across local, staging, and production
✅ Simplified module management - Seamlessly develop and test custom modules
✅ Persistent data - Maintain your database between sessions and restarts
📦 The Docker Compose Configuration
Here's the docker-compose.yml file I created:
version: '3.1'
services:
odoo:
image: odoo:18.0
env_file: .env
depends_on:
- psql
ports:
- "8069:8069" #port mapping(custom-port:8069)
volumes:
- data:/var/lib/odoo
- .:/etc/odoo
- ./custom_addons:/mnt/extra-addons
psql:
image: postgres:17
env_file: .env
volumes:
- db:/var/lib/postgresql/data/pgdata # Note: corrected from pgsql to postgresql
volumes:
data:
db:
This setup defines two essential services for running Odoo efficiently:
🟣 Odoo: Pulls the official Odoo 18 image (or a custom one of your choice), mounts project files, and loads custom addons for seamless development.
🐘 PostgreSQL: Runs a PostgreSQL 17 container with a persistent volume, ensuring data integrity across restarts. You can also specify a different PostgreSQL version or custom image.
📁 Project Structure
Your project directory should look like this:
my-odoo-project/
├── docker-compose.yml
├── .env
├── custom_addons/
└── odoo.conf
Environment Variables (.env)
# PostgreSQL env variables
POSTGRES_DB=postgres
POSTGRES_PASSWORD=odoo18
POSTGRES_USER=odoo18
PGDATA=/var/lib/postgresql/data/pgdata # Note: corrected from pgsql to postgresql
# Odoo env variables
DB_HOST=psql
DB_PORT=5432
DB_USER=odoo18
DB_PASSWORD=odoo18
Odoo Configuration (odoo.conf)
I've included a standard configuration that you can customize:
[options]
admin_passwd = strong@weak_password.com
db_host = psql
db_user = odoo18
db_password = odoo18
db_port = 5432
addons_path = /mnt/extra-addons
csv_internal_sep = ,
db_sslmode = prefer
db_template = template0
gevent_port = 8072
http_enable = True
http_interface =
http_port = 8069
import_partial =
limit_memory_hard = 4684354560
limit_memory_soft = 4147483648
limit_request = 65536
limit_time_cpu = 600
limit_time_real = 1200
limit_time_real_cron = -1
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile =
max_cron_threads = 2
osv_memory_age_limit = False
osv_memory_count_limit = 0
pg_path =
pidfile =
proxy_mode = False
reportgz = False
screencasts =
server_wide_modules = base,web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_ssl_certificate_filename = False
smtp_ssl_private_key_filename = False
smtp_user = False
syslog = False
test_enable = False
test_file =
test_tags = None
transient_age_limit = 1.0
translate_modules = ['all']
unaccent = False
upgrade_path =
websocket_keep_alive_timeout = 3600
websocket_rate_limit_burst = 10
websocket_rate_limit_delay = 0.2
without_demo = False
workers = 0
x_sendfile = False
🧪 Getting Started in 3 Simple Steps
1️⃣ Create your project directory with the files above
2️⃣ Add your custom modules to the custom_addons/ directory
3️⃣ Launch everything with one command:
docker-compose up -d
🚀 Setting Up Your Odoo Database
After launching Docker Compose for the first time:
1️⃣ Visit http://localhost:8069
in your browser
2️⃣ You'll see Odoo's Database Manager
3️⃣ Enter your database name and credentials
4️⃣ Click "Create Database"
That's it! Your Odoo instance is now ready to go. 🎉
Odoo Database Manager
🧩 Custom Module Development Workflow
The real power of this setup is in the development workflow:
1️⃣ Changes to modules in ./custom_addons
are instantly available after a refresh
2️⃣ No need to rebuild containers for most code changes
3️⃣ Module updates can be applied through Odoo's interface or via the command line
Conclusion
This Docker Compose setup has dramatically improved my Odoo development efficiency. Whether you're an ERP developer, consultant, or exploring Odoo for your business, this approach eliminates configuration headaches and lets you focus on what matters - building great solutions.
What Odoo development challenges are you facing? I'd be happy to discuss optimization strategies or answer questions about this setup.
💬 How do you manage your Odoo environments? Share your setup in the comments or reach out to us at
This content originally appeared on DEV Community and was authored by Treekon Ventures

Treekon Ventures | Sciencx (2025-03-30T15:20:00+00:00) Streamlined Odoo 18 Development with Docker Compose: A Developer’s Guide. Retrieved from https://www.scien.cx/2025/03/30/streamlined-odoo-18-development-with-docker-compose-a-developers-guide/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.