Launch Odoo 18 Like a Pro with Docker Compose

Launch Odoo 18 Like a Pro with Docker Compose

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. 😎

Share :

Related Posts

Run Odoo Using Docker – A Beginner-Friendly Guide

Run Odoo Using Docker – A Beginner-Friendly Guide

Curious about running your own Odoo server, but not ready to dive into Docker Compose or full production setups? This guide walks you through launching Odoo using simple Docker commands β€” step by step β€” with clear explanations so even first-timers can follow along.

Read More
How to Install Docker & Docker Compose on Ubuntu, Windows, and macOS

How to Install Docker & Docker Compose on Ubuntu, Windows, and macOS

In this guide, we’ll walk you through installing Docker and Docker Compose on Ubuntu (Linux), Windows, and macOS.

Read More

Cookie Time!

We use cookies to make your experience sweet and crispy. For more information, please read our Privacy Policy .