Running Odoo in production with Docker and Docker Compose

Running Odoo in production with Docker Compose means persistent volumes, a mounted odoo.conf, controlled addons and version-pinned images. This page explains how to build it and what to confirm first.

On this page

Running Odoo in production with Docker and Docker Compose: what it involves

This section explains what a team takes on when it runs self-hosted Odoo in containers: the official odoo image paired with a PostgreSQL container, the named volumes that hold the filestore and the database, and the Compose file that ties them together. A container setup moves packaging out of the operating system, but it does not remove the work of planning the database, the configuration file, the addons path and the upgrade cycle. Docker Compose fits a team that wants the whole stack defined in one versioned file and rebuilt the same way on each host. A systemd install on Ubuntu or Debian fits better when the team wants Odoo packaged directly on the host and managed by the distribution's tools.

Licensing shapes the decision before any container is built. The Community edition is open source under the LGPL-3.0 license and can be run without a subscription. The Enterprise edition needs a subscription, and its source code is not publicly available, so Enterprise addons have to be obtained through a subscription or partner access. Odoo's pricing page states that only the Custom plan can be hosted on-premise or on Odoo.sh, and that the Custom plan is the one that includes custom modules and external API access. Confirm the plan and the edition before choosing an image, because the answer determines whether the team builds on the Community image alone or adds Enterprise code to it.

The team should confirm two things early: which Odoo major version it will run, and how it will move to the next one. Image tags follow major versions, and the standard support window for each version sets the deadline for an upgrade. Odoo's standard and extended support documentation lists the dates for each release, and security patches are only provided during standard support, so a container pinned to an expired version carries unpatched risk. Ask for the support end date of the chosen version, plan a test restore before each upgrade, and confirm who owns image rebuilds when Odoo releases a fix.

How the Odoo, PostgreSQL and volume containers fit together

The diagram starts at the reverse proxy on the trust boundary, which forwards browser traffic to the odoo container on port 8069 for regular pages and port 8072 for websocket and longpolling traffic. The odoo container reads its mounted odoo.conf from /etc/odoo and loads any extra addons from a mounted directory. It talks to the PostgreSQL container over the Compose network, and the database and filestore each sit on a named volume. Check that the proxy is the only published entry point, that the database port is not exposed to the host, and that both volumes survive a container rebuild.

Request path and storage for a self-hosted Odoo stack in Docker Compose.

Which Compose configuration options fit which situation

This table compares the main Compose choices for an Odoo container and PostgreSQL pair, with the situations each one suits and the trade-off it carries. Read each row as a decision: find the situation closest to yours, then check the trade-off before you commit to it.

Configuration optionWhen it fitsTrade-off to weigh
Named volumes for the filestore and databaseSingle-host installs where Docker manages storage and you back up through volume-aware toolingData sits in Docker-managed locations, so backup and restore steps must be written and tested for your host, not assumed
Bind mounts for the filestore and databaseTeams that want files at a known host path for direct backup, snapshotting or inspectionHost permissions and paths become your responsibility, and ownership mismatches between host and container are a common failure point
odoo.conf mounted read-only at /etc/odooProduction installs where configuration changes go through review and the container should not rewrite its own settingsAny change needs a file edit and container restart, so keep the file under version control and confirm which values the image expects to set
Extra addons mounted as a volumeCustom or third-party modules that must be updated without rebuilding the imageModule versions must match the Odoo major version exactly, and the addons path must be listed in the configuration
Image tag pinned to one major versionProduction systems where upgrades are planned, tested and scheduled rather than applied automaticallyYou must schedule and test each major upgrade yourself, and the pinned line will eventually leave standard support
Floating tag for the major versionDevelopment or test environments that should pick up minor and patch builds without manual editsUnplanned behavior changes can reach a running database, so avoid floating tags on production without a staging test
Multi-threaded server (default in the container)Small installs, development or evaluation where one process is enough for the user countLong requests can block other users, and the container does not give you the worker tuning that a production load needs
Multi-processing workers configured in odoo.confProduction load with several concurrent users, where requests and scheduled jobs must not competeWorker counts, memory limits and cron workers must be sized for your hardware, and the right values should be confirmed in your environment

Why the container defaults to the multi-threaded server and when to change it

The official image starts Odoo with the multi-threaded server by default, which handles requests as threads inside a single process. That is a reasonable starting point for a pilot, a test environment or a small team, where few users are active at the same time. The trade-off is that threads share one process, so a long report, a large import or a heavy request from one user can slow down everyone else. Before you assume the container behaves a certain way, check what it actually runs: read the container command, confirm which odoo.conf it loads, and look for the server mode in the startup log.

When concurrent users grow, or when one slow operation must not block the rest of the company, you switch to the multi-processing server by setting the workers key in odoo.conf. Odoo also needs separate capacity for cron jobs and long polling, so the worker count affects more than request throughput. A value copied from a sample file can starve one of those roles or push the host into memory pressure, and a container memory limit can end worker processes without a clear error. Confirm the sizing rules for your Odoo version in Odoo's documentation, and plan the memory limit of the container with the worker count in mind. Sizing for a specific user count is covered on the server sizing page.

Changing the setting also changes the load on PostgreSQL, because each worker holds its own database connections. Check the PostgreSQL connection limit against the worker count before you raise the value, and set the db_maxconn key deliberately if your version supports it. Mount the edited odoo.conf at /etc/odoo, keep it in the same version control repository as the Compose file, and test under realistic load before go-live. The Odoo on-premise documentation is the reference for the options that apply to your version.

How to set up Odoo and PostgreSQL in Docker Compose

This sequence builds a Compose stack with a PostgreSQL container and an Odoo container, each with persistent storage and configuration kept outside the image. Each step ends with a check, so you know the stack is ready for a first database and sign-in.

  1. Prepare the host and generate secrets

    The administrator installs Docker Engine and the Compose plugin on the host, then creates a project directory. They generate a random database password and a master password, store both in a .env file, and restrict the file to the owner. Keep the master password out of version control, because it controls the Database Manager. Check: docker compose version returns a version, and ls -l .env shows permissions limited to the owner.

  2. Write the Compose file with PostgreSQL

    Create a docker-compose.yml file with a db service for PostgreSQL and an odoo service for the Odoo image. Attach a named volume to the database data directory and a second named volume to the Odoo filestore, so attachments survive container replacement. Do not publish the PostgreSQL port to the host, and make the Odoo service depend on the database. Check: docker compose config prints the merged file without errors, and both volumes appear under the top-level volumes key.

  3. Create odoo.conf with database and master password

    Create an odoo.conf file on the host and mount it at /etc/odoo in the container. Set db_host to the database service name, add the database user and password from .env, and set admin_passwd to the master password. Point the data directory at the filestore volume and list the addons path that the next step will use. Check: the Odoo container starts and its logs show the server listening on port 8069 without configuration errors.

  4. Mount extra addons into the container

    Place custom or third-party modules in a host directory and mount it into the Odoo container at the addons location your image documentation specifies. Mount it read-only where possible, and add the same path to addons_path in odoo.conf. Enterprise addons need a subscription, so keep them in a separate directory that is only mounted for licensed installations. Check: docker compose exec odoo ls on the addons path lists each module folder, and each contains a __manifest__.py file.

  5. Pin the image tag for your major version

    Replace any floating latest tag with a tag that matches the major version you plan to run, and confirm that the tag exists on the image's registry page. Choose the version against Odoo's support windows, because standard support for 18.0 runs until September 2027 and for 19.0 until September 2028. Record the tag and image digest in your change log. Check: docker compose images shows the exact tag, and the image tag matches the version recorded in your plan.

  6. Start the stack and create the first database

    Run docker compose up -d, then open the Database Manager on port 8069 in a browser and enter the master password. Create the first database, choosing a language, country and admin password that your team has agreed. The database is created inside the PostgreSQL container and its data goes to the named volume. Check: docker compose ps shows both services running, and the new database appears in the database selector.

  7. Verify login, filestore writes and PDF output

    Sign in as the admin user, then upload a small attachment to a record and confirm it is saved. Use docker compose exec odoo to list the filestore directory and find the new file. Print a standard document such as a quotation to PDF to test the report engine. Restart the stack and sign in again to confirm the data persisted. Check: login works, the attachment exists in the filestore, and the PDF renders with its header and footer. If the PDF is missing content, review the report engine settings before go-live.

Choosing an image tag and planning major version moves

An image tag decides which Odoo major version runs in your containers, and that version sets how long you can stay on it without an upgrade. The cards below cover the support windows, the cadence of forced upgrades on hosted plans, and why every move starts on a tested copy of your database.

Pin a major version tag

Pin the container to a specific major version tag rather than a floating tag, so a routine image pull cannot move a production database to a new release. Confirm the exact tag names on the official image listing on Docker Hub before writing them into your Compose file, because tag naming conventions can change. Record the tag in version control next to the odoo.conf file so every rebuild is traceable.

Source install docs

Support windows from 17.0 to 20.0

Standard support is the period that includes security updates and bug fixes, and it is the window to plan around. Odoo 17.0 standard support ended in September 2026, Odoo 18.0 runs until September 2027, Odoo 19.0 until September 2028 and Odoo 20.0 until September 2029. A container on 17.0 today is already outside standard support, so confirm your position against the support page before the next release cycle.

Support policy docs

SaaS releases cannot use extended support

Odoo SaaS versions are released every two to three months and cannot use extended support. If your containers run a version that Odoo delivers as a SaaS release, you cannot rely on paid extended support to keep that version patched. Ask your vendor or partner which release train your chosen tag belongs to, and plan upgrades on that train rather than on the longer on-premise cycle.

Two-year mandatory upgrade cadence

On Odoo Online and Odoo.sh, major version upgrades are mandatory every two years. Self-hosted containers are not on that platform schedule, but the same support windows still decide when a version stops receiving security patches. Use the two-year cadence as a planning ceiling: budget the upgrade work, schedule it in the calendar and avoid letting a major version run past its standard support end date.

Enterprise upgrade service needs a subscription

Odoo's upgrade service moves a database to a newer supported version through an upgraded test database. On-premise use requires an Enterprise subscription, and the Community edition has no access to that service. If your Compose stack runs Community, the upgrade path is a different project, so confirm the route before you commit to a major version. Ask for the upgrade method in writing as part of the quote.

Upgrade service docs

Test every move on a copy first

Run each major version move against a copy of the production database and filestore before any change reaches production. The upgraded test database should be checked for custom module errors, failed reports, broken scheduled actions and integrations that depend on old API behavior. Record how long the test run takes, because that time sets the maintenance window for the real cutover.

Limits to confirm in your environment

Can I add Enterprise modules to the community Odoo image?

Possibly, but confirm it with Odoo before you plan around it. Enterprise source code is not publicly available and requires a subscription or partner access, so it is not in the public community image. Mounting Enterprise addons into the community image or building your own image is covered on the sibling Enterprise Docker page, and it only works if your subscription gives you the code. Activation is a separate step: Enterprise databases are activated by entering the subscription code in the database. Ask Odoo how your subscription delivers Enterprise code, which builds you may keep in an internal registry, and how often you must rebuild when Odoo publishes new builds. Read the Odoo on-premise documentation for the activation steps.

Which wkhtmltopdf version does the image ship for PDF reports?

Check it inside the exact image you run, because Odoo's PDF reports depend on a specific wkhtmltopdf build. Run wkhtmltopdf --version in the container for the tag you pinned, then compare the result with the version Odoo documents for your release. A mismatch usually shows up as invoices without headers or footers, or as reports that fail to render. If the bundled build does not match, you have two options: a derived image that installs the correct package, or a different base image that you test end to end. Also confirm the report base URL and web base URL settings behind your reverse proxy, since PDF rendering fetches assets through those addresses. Test one invoice and one statement on staging before every image upgrade.

Is there an arm64 build for my Odoo version?

Confirm availability for the specific tag you intend to pin, not for the product in general. Check which platforms that tag publishes, then run a test install on the target architecture. Cover PDF generation, Python dependency installs, any Enterprise addons and your custom modules, because native packages are where ARM differences show up. Ask whether the arm64 variant follows the same release and patch timing as the amd64 image, since a lagging build can leave you on an unpatched version. If the arm64 build is missing for your version, decide early whether to change architecture, wait for a build or run a source install on that hardware. Record the result in your change log so the next upgrade repeats the same checks.

What outbound network access does a Docker Odoo install need?

Start from the endpoints Odoo documents and the services your apps use, then confirm each one with your firewall team. Typical outbound needs are:

  • the upgrade service script, which Odoo's upgrade documentation ties to an Enterprise subscription
  • in-app purchase services such as SMS, OCR and other paid services your apps call
  • bank synchronization, payment and shipping APIs that your configuration uses
  • package repositories and image registries used when you build or pull images

A default-deny egress policy blocks these silently, so features fail in ways that look like Odoo bugs. Test each integration on staging after the firewall is locked down. Document the destination, port, owner and business reason for every rule. The sibling page on restricted or air-gapped networks covers what stops working without each service.

How long will my Odoo version receive security patches?

Standard support covers the first three years after a major release, including security updates and bug fixes, on Odoo Online, Odoo.sh and on-premise. The dates Odoo lists are 18.0 until September 2027, 19.0 until September 2028 and 20.0 until September 2029. Standard support for 17.0 ended in September 2026. Paid extended support exists after that, but it is limited to Odoo.sh for select versions and to on-premise, and security patches are only provided during standard support. Confirm with Odoo whether extended support covers your version and whether it includes security patches. Because a pinned image tag does not change by itself, schedule your move to a supported major version before your window closes.

Will one Docker host support my number of Odoo users?

The container image alone cannot answer this. Worker count, memory limits and request timeouts are set in odoo.conf and in the host or container resources, and they must be sized together. Odoo documents a worker formula based on CPU count, and you should confirm the result with a load test on a staging copy that matches your production data volume and concurrency. Ask for three things before go-live: the number of workers and cron workers in use, where PostgreSQL runs and whether it shares host resources with Odoo, and the measured response times at peak. Cron jobs, report generation and imports compete for the same capacity, so test them during the load run, not separately.

Can DeployOpen run this Docker setup for us, and what would it cost?

DeployOpen implements, customizes, hardens, backs up, upgrades and supports self-hosted Odoo inside your own infrastructure, and most engagements are fixed-scope with the scope, deliverables and timelines agreed in writing before work starts. DeployOpen does not publish a price list, and a quote follows from that written scope. The main cost drivers are the apps and editions you license from Odoo, which you pay for directly; the number of custom modules and integrations; data migration; and whether you want a retainer for upgrades and continuous testing. Ask any partner to split the quote into one-time build work and recurring support, and to list which items depend on your Enterprise subscription.

Official Odoo documentation for self-hosted installs

Before you finalize a Docker-based Odoo design, read Odoo's own documentation for self-hosted installs. The on-premise documentation covers activating an Enterprise subscription with the subscription code, the packaged installers, database duplication with neutralization for test copies, and the other deployment paths Odoo supports. Compare those steps with your container plan, especially where the image, the database and the test copy process differ from what Odoo describes for its packaged installs. Ask your team to confirm which Odoo version tag the image uses and that the documented on-premise steps still apply to it.

The source installation guide is the reference for the dependencies and layout that a container hides from you. Use it to check the Python and system packages your custom addons may need, and to understand which parts of the stack your image build must reproduce if you add modules or change the base image. Treat it as a checklist for your Dockerfile review, not as a replacement for the container build, since the image already handles many of these steps for you.

Finally, read the standard and extended support page before you pick an image tag to run in production. It sets out how long each major version receives security updates and bug fixes, and it states that security patches come only during standard support. Confirm the support end date for the version you plan to run, and build your image update schedule around it. Decide who will rebuild and redeploy the image when a supported release or security fix arrives.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.