Financial TimesAmericas' Fastest-Growing 2025
Certified PartnerOdoo Gold · Adobe Gold Solution · Shopify Premier partnershipsOdoo Gold · Adobe Gold · Shopify Premier partnerSee all
One business dayA senior architect replies to every inquiry · +1 (631) 897-7276Architect reply within one business dayLet's talkCall us
Inc. Regionals 2025Fastest-growing private companies in AmericaInc. Regionals 2025 honoreeSee awards
Americas' Fastest-Growing Companies 2025Recognized by the Financial TimesFT Fastest-Growing Companies 2025See the rankingRanking
4.8 / 5 on Clutch265 verified client reviews4.8/5 on Clutch · 265 reviewsRead the reviews
4.8 · 265 Clutch reviews
US United States
October 28, 20209 min readUpdated on October 13, 2026

Odoo Docker setup: running Odoo 20 with Compose, from laptop to production

· Vice President, eCommerce and ERP
Odoo Docker setup: running Odoo 20 with Compose, from laptop to production

The official Odoo Docker image will give you a working Odoo 20 server in a few minutes. The trouble sits in the examples around it. The image page still pairs Odoo with a postgres:15 container, while Odoo 20's own documentation sets the floor at PostgreSQL 16.

This guide gets you from an empty folder to a running Odoo container on Docker Compose, then covers the development loop and the changes production needs. Get the versions and volumes right now. The database you create today is the one you'll back up, upgrade and migrate for years.

Before you start

You need three things in place:

  • Docker Engine with the Compose plugin. Any recent Engine works. Check with docker --version and docker compose version. This guide uses docker compose, with a space.
  • A pinned Odoo version. Use a version tag, never latest (see the table below).
  • A Postgres choice. Odoo 20 requires PostgreSQL 16 or later. If you plan to use Odoo's AI features, the database also needs the pgvector extension. That changes the db image you pick in step 4.

The official image is published on Docker Hub and maintained by Odoo in the odoo/docker repository. It runs Odoo Community on Ubuntu 24.04 (Noble) and doesn't include a database. As of October 2026, its supported tags cover three versions:

Tag Odoo version Build checked
20.0, 20, latest Odoo 20 20.0-20261015
19.0, 19 Odoo 19 19.0-20261015
18.0, 18 Odoo 18 18.0-20261015

Each tag ships for amd64, arm64v8 and ppc64le. Odoo 20 was released in September 2026, with standard support planned until September 2029.

Why pin? The day latest moves to Odoo 21, a routine restart would try to open your Odoo 20 database with new code. That's a migration, not an update.

One more question before any commands: who will run this server? Docker hands you patching, backups, monitoring, certificates and upgrades. If nobody on the team owns those jobs, Odoo's hosted options are the safer route. Odoo Online is the hosted edition. Odoo.sh runs custom modules for you, creates staging servers from GitHub branches and advertises daily backups. Docker makes sense when you need your own cloud account, a specific data region, or Odoo next to services you already operate. The Odoo ERP implementation cost guide shows how hosting fits the wider budget.

1. Create the project folder

mkdir -p odoo20/config odoo20/addons
cd odoo20

config will hold your odoo.conf. addons is where your custom modules live.

2. Copy the configuration template

Mounting your own folder over /etc/odoo replaces the image's default configuration file. So start from the Odoo 20 template in the official repository and save it as config/odoo.conf.

The template already sets addons_path = /mnt/extra-addons, data_dir = /var/lib/odoo and http_interface = 0.0.0.0. The container needs all three, so edit around them rather than deleting them.

3. Store the database password as a secret

echo "choose-a-long-random-password" > odoo_pg_pass
chmod 600 odoo_pg_pass

Both containers read this file. Odoo's entrypoint picks it up through PASSWORD_FILE, so the password never appears in the compose file.

4. Write the Odoo Docker compose file

Save this as compose.yaml. It adapts the last Compose example on the official image page for Odoo 20:

services:
  web:
    image: odoo:20.0
    depends_on:
      - db
    ports:
      - "8069:8069"
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addons:/mnt/extra-addons
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD_FILE=/run/secrets/postgresql_password
    secrets:
      - postgresql_password
    restart: unless-stopped
  db:
    image: postgres:17
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
    secrets:
      - postgresql_password
    restart: unless-stopped

volumes:
  odoo-web-data:
  odoo-db-data:

secrets:
  postgresql_password:
    file: odoo_pg_pass

Three things differ from the official example. The Odoo tag is 20.0, not 17.0. The database is postgres:17, which clears Odoo 20's PostgreSQL 16 minimum. And both services restart on their own after a host reboot.

You could pick postgres:18, but mind the path. The official Postgres image moved its data folder in version 18 to /var/lib/postgresql/18/docker. With 18, mount the volume at /var/lib/postgresql and drop the PGDATA line, as the Postgres image page describes.

Planning to use Odoo's AI features? Swap the db image for pgvector/pgvector:pg17. The pgvector project publishes it as the official Postgres image with pgvector added. Make that choice before you create your first database, not after.

5. Start the containers and create a database

docker compose up -d
docker compose logs -f web

On start, the image's entrypoint waits up to 30 seconds for PostgreSQL. When the log shows the HTTP service running, open http://<server-ip>:8069 and you'll see the database creation screen.

Odoo 20 skips demo data unless you ask for it. Keep that default on anything that faces the internet.

For reference, the Odoo 20 Dockerfile already installs the Python dependencies, wkhtmltopdf for PDF reports and the PostgreSQL client. It exposes port 8069 for the web client, plus 8071 and 8072. Odoo itself runs as a non-root user named odoo.

6. Set up the development loop

The same compose file works for day-to-day development with a few additions.

Dev mode. Your modules go in ./addons, which maps to /mnt/extra-addons inside the container. To reload Python changes and read templates from disk as you work, add this to the web service:

    command: -- --dev=all

According to the Odoo 20 command-line reference, --dev=all covers XML, reload, QWeb and access checks. It's meant for development only, so keep it out of any production compose file.

One-off commands. The entrypoint passes odoo subcommands through, so docker compose run handles scaffolding, module updates and the shell:

# Create a module skeleton in your addons folder
docker compose run --rm web odoo scaffold my_module /mnt/extra-addons

# Update a module on a database, then stop
docker compose run --rm web odoo -d mydb -u my_module --stop-after-init

# Open the Odoo shell (a Python console with the ORM loaded)
docker compose run --rm web odoo shell -d mydb

Each command starts a throwaway container with the same volumes and database settings as web. Your running Odoo process stays untouched.

OCA and other community modules. Modules from the Odoo Community Association are ordinary addons. Clone each repo you need into ./addons as a git submodule, which keeps versions pinned in your own repo. Then list each folder in addons_path. Match the branch to your Odoo version: a module written for Odoo 19 may not load on Odoo 20. Some OCA modules also need extra Python packages, and those belong in your own image.

That leads to the last habit. Bind-mounted addons are convenient while you code. For releases, build your own image FROM odoo:20.0 with the addons copied in, so each release is one tagged image you can test and ship as is.

7. Harden it for production

The image's defaults are tuned for getting started. Odoo's deployment documentation lists what a live database needs on top.

Switch to workers

The multithreaded server is the default, Docker containers included. Production should run the multi-processing server by setting workers in odoo.conf. Odoo's rule of thumb is (CPU cores × 2) + 1 workers, and one worker serves about 6 concurrent users. On a 4-core server, Odoo's own sample lands on 8 workers plus 1 for scheduled actions, with about 3 GB of RAM for Odoo.

Put HTTPS in front

Odoo sends login details in cleartext, so a secure deployment must sit behind HTTPS. Odoo's docs use Nginx as the reverse proxy: terminate TLS there, set proxy_mode = True and route /websocket requests to port 8072.

Lock down the database manager

Odoo strongly recommends disabling the database manager on any internet-facing system. Set dbfilter and db_name so each hostname maps to one database, then set list_db = False. If you keep the manager, replace the default admin_passwd with a long random value.

In practice, one host with Docker Compose fits a single company with modest traffic. Docker Swarm or Kubernetes come in when you need several hosts, rolling releases or automatic failover. Running more than one Odoo container also means a shared filestore that every container can reach.

8. Back up both halves and plan upgrades

An Odoo database is two things: the PostgreSQL database and the filestore under /var/lib/odoo/filestore/. A pg_dump with no matching filestore gives you records whose attachments are missing. Back up both on the same schedule, and test a restore.

A dump in PostgreSQL's custom format looks like this:

docker compose exec -T db pg_dump -U odoo -Fc mydb > mydb.dump

Copy the filestore volume at the same time, and schedule both with cron.

Updates come in two sizes. Odoo builds a new release of each version nightly, and the image is updated regularly to pick up recent releases. Moving to a newer build of the same major version is a pull and a restart on the same volumes:

docker compose pull
docker compose up -d

Try the new build on a copy of your production database first. A major version change, say Odoo 19 to 20, is a database migration, not a tag change. It runs through Odoo's upgrade service or the community OpenUpgrade project.

Troubleshooting

Odoo can't reach the database

The image looks for PostgreSQL at the host name db by default, so the database container or service must carry that name. Older tutorials, including an earlier version of this one, joined two docker run containers with --link db:db. Per Docker's documentation, links on the default bridge network are deprecated. Docker Engine 29.6 prints a warning, and removal is scheduled for Docker Engine 30.0.

If you prefer plain docker run, use a user-defined network instead:

docker network create odoo-net
docker run -d --name db --network odoo-net \
  -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres \
  -v odoo-db:/var/lib/postgresql/data postgres:17
docker run -d --name odoo --network odoo-net -p 8069:8069 \
  -v odoo-data:/var/lib/odoo odoo:20.0

Use odoo as a password only on a laptop that's never exposed.

Odoo ignores the database settings you passed

Check odoo.conf. If db_host, db_port, db_user or db_password is set there, the entrypoint leaves that value alone and your environment variable loses. Pick one place for database settings and keep them there. These are the variables the image reads:

Variable What it sets Default
HOST PostgreSQL server address db
PORT PostgreSQL port 5432
USER PostgreSQL role Odoo connects as odoo
PASSWORD Password for that role odoo
PASSWORD_FILE File to read the password from (for Docker secrets) not set

The database runs PostgreSQL 15

If you copied an older example, look at the db image tag. Odoo 20's docs set the minimum at PostgreSQL 16, so a postgres:15 service is below the floor. On a new install, change the tag before you create any database.

Data is gone after the container was re-created

Both data folders must sit on named volumes: /var/lib/odoo in the Odoo container and the Postgres data folder in the db container. The /var/lib/odoo mount point also has to match data_dir in odoo.conf. On the Postgres side, a wrong mount path sends data to an anonymous volume that isn't reused when the container is re-created. Recheck the path for your Postgres version (step 4).

Websocket requests fail behind the proxy

Websocket traffic goes to port 8072 once you run workers. Route /websocket to that port in the proxy, publish 8072 to the proxy as well as 8069, and set proxy_mode = True.

Before this goes live

Brainvire is an Odoo Gold Partner. Before a Docker setup like this goes live, our Odoo ERP team would start with the three steps that are hardest to fix later: volumes, hardening and backups. If Odoo also has to exchange data with your other systems, the team can plan the Odoo integrations in the same pass. Talk to the team.

FAQ

Is there an official Odoo Enterprise Docker image?

No. The official image runs Odoo Community. Odoo's install guide describes Enterprise as the Community server plus a folder of extra addons. Mount those addons into the container and list their folder first in addons_path, ahead of your other paths.

Can I run Odoo in Docker on AWS?

Yes. The image runs anywhere Docker runs, including an Amazon EC2 instance. You can also drop the database container and point Odoo's HOST variable at Amazon RDS for PostgreSQL, which offers PostgreSQL 16, 17 and 18. You still own the proxy, the HTTPS certificate and the filestore backups.

Does the Odoo Docker image run on ARM machines?

Yes. Every supported tag ships for amd64, arm64v8 and ppc64le. The same odoo:20.0 tag pulls the matching build on an Intel server or an ARM laptop.

ShareLinkedInXEmail

Related reading

Planning an Odoo implementation?

Explore Odoo ERP services