Hosting multiple Odoo databases on one server with dbfilter

Running several companies or environments on one Odoo server is practical when dbfilter maps each hostname to exactly one database. This page covers the patterns, the trade-offs and the checks that keep websites and the selector working.

On this page

When one Odoo server should host several databases with dbfilter

The dbfilter setting limits which databases an Odoo instance serves for a given request, and Odoo uses the hostname of that request to make the choice. Teams need it when one group runs several companies, brands or test environments and wants fewer servers to patch and back up. A single Odoo process can serve many databases, so consolidating onto one instance is a common plan, but it changes where isolation comes from. Each Odoo database holds its own data and has its own filestore, yet the same running code and the same server process answer for all of them.

That means isolation depends on the filters, the database manager and the access controls you configure, not on separate processes. If a request reaches the instance under a hostname that does not match the intended database, the wrong company's data can be displayed or the wrong website served. Before you commit, decide which hostnames map to which databases, who may create or drop databases, and whether each brand needs its own administrators. Confirm with the Odoo documentation for your version how the database selector and the filter interact, and test each hostname on a staging copy before you open the instance to users.

Consolidation also shares resources. Workers, memory, PostgreSQL connections and scheduled actions are pooled across every database on the instance, so one busy company can slow the others. Ask your team or partner to size the server for the combined load, not for the largest database alone, and to document a rollback plan that can move one database to a separate server without touching the rest. Those decisions, made early, determine whether one server stays a simplification or becomes a shared risk.

Which dbfilter and database options fit each setup

This table compares the three ways to control which Odoo databases a server exposes: a dbfilter pattern, an explicit database list and no filter. Read each row against your hostnames and the number of companies or environments you run. The main takeaway is that a filter tied to hostnames is usually the safer default once each site maps to one database.

OptionWhen it fitsMain riskWhat to confirm
dbfilter with %h (full hostname)Each hostname maps to exactly one database, and the full hostname matches the database nameRequests from a hostname with no matching database fail, and naming drift between DNS and database names breaks sitesHow %h is matched against database names in your version's configuration reference, and how the proxy passes the Host header
dbfilter with %d (first subdomain label)Subdomains such as company1.example.com map to databases named company1Unexpected hostnames can match a database, and a wrong label can expose another tenant's data if names overlapHow %d is derived from the Host header, and whether your reverse proxy preserves it unchanged
Database list (--database)A small, fixed set of databases that rarely changesAdding a database requires a configuration change and restart, and the list can drift from what actually exists on PostgreSQLExact syntax for listing databases and whether the selector still appears when a list is set
No filterSingle-database development on a private networkWebsites fail when several databases exist, and the database selector can expose every database to anyone who reaches the login pageWhether the database manager is protected by a master password and which database Odoo chooses when more than one exists
Database selector left enabledStaff who switch between databases on purpose from one addressUsers see database names, and the manager can be reached by anyone with network accessWhether the database manager can be disabled or restricted in your version, and how the master password is set

How hostname patterns map databases in common layouts

This layout gives each company its own database and its own subdomain, so the hostname alone can select the database. In an illustrative setup, a company called Alpha is served at alpha.example-erp.test and a company called Beta at beta.example-erp.test. A dbfilter pattern of ^%d$ tells Odoo to match the database name to the first label of the hostname, so alpha selects the database alpha. The pattern works only when database names and subdomain labels are kept identical, which is a naming decision to make before the first database is created.

  • Pattern: dbfilter = ^%d$ matches the full first label of the host against the full database name.
  • Failure mode: if a second database is named alpha_test and the pattern is loose, a request for alpha may match more than one database, so use anchors.
  • Naming rule: lowercase names without dots or underscores avoid surprises in subdomain matching.
  • Website routing: each company's public website depends on this match, so a mismatch shows the wrong company's pages.
  • Selector: keep the database selector enabled only while databases are being created, then block it once every hostname maps to one database.

Check that every hostname resolves to exactly one database name in a test request before you publish DNS records.

Setup sequence for one database per hostname

This sequence moves an Odoo server from a shared database selector to a setup where each hostname opens exactly one database. Each step ends with a check so the team knows the mapping holds before the selector is turned off.

  1. Inventory databases and hostnames

    The platform owner lists every Odoo database on the server, its purpose (production, staging, a company or a test copy) and the public hostname that should reach it. Record the mapping in a single table and mark which hostnames serve websites, portals or payment return URLs, because those depend on the filter most. Confirm the list with the business owners of each company before changing any configuration. Done when every database has exactly one intended hostname, or an explicit decision that it has none, and nobody needs to guess which company a URL should open.

  2. Choose the dbfilter pattern

    The platform owner decides how Odoo should match a request to a database. A pattern using %h matches the hostname and %d matches the database name, which works well when each hostname is named after its database. An explicit regular expression or a fixed value suits names that do not follow a convention. Write the chosen pattern next to the mapping table and check each hostname against it by hand, including staging and any test names. Done when every hostname in the table matches the pattern to exactly one database name and no other.

  3. Set the database list if one is used

    If the server should only ever serve a known set of databases, the platform owner sets the list option in the configuration file so Odoo considers only those names. Keep the list aligned with the mapping table, so a database added later is not left open by accident. Review the configuration file procedure in the sibling topic on setting up a production Odoo server before editing it, and restart the service after the change. Done when the configured list matches the inventory exactly and Odoo starts without errors in its log.

  4. Configure the reverse proxy to pass the Host header

    The infrastructure or network engineer makes sure the reverse proxy forwards the original hostname to Odoo, so the filter sees the name the user typed and not the internal address. The proxy setup is covered in the sibling topic on running Odoo behind Nginx with SSL and proxy mode, so follow that page rather than repeating its procedure here. Test from outside the proxy with a request that sets each hostname, and confirm Odoo receives it in its logs or through a test page. Done when each public hostname reaches Odoo with its own name intact.

  5. Create and test each database

    The Odoo administrator creates or restores each database, sets its company details and confirms that the correct company name, logo and currency appear. Log in on each hostname with a test user and open a website page, a portal page and a report, since these are where a wrong database shows up first. Keep a note of any hostname that returns a database selector, an error or another company's data. Done when every hostname loads its own database for both the back office and the public website, and no hostname shows data from a different database.

  6. Block the database selector

    Once each hostname resolves to one database in testing, the administrator turns off the database selector and the database manager, so visitors cannot list or pick databases from the login page. Hardening the database manager in full is covered in the Odoo security hardening topics, so use those for the wider controls. Confirm the change in the configuration file and restart the service. Done when the selector no longer appears on any hostname and each one still reaches its own database.

  7. Recheck every hostname after the change

    The platform owner runs the same hostname checks from the inventory table once more, this time with the selector disabled, and includes a request to an unknown hostname to confirm it does not reveal a database. Record the results against the mapping table and store them with the change record. Schedule the same check after each server update or proxy change, because a new hostname or a changed header can break the mapping. Done when the recorded results match the mapping table for every hostname and the change record is complete.

How a hostname becomes a database in a request

The request starts in the browser, resolves through DNS to the reverse proxy, which forwards the Host header to Odoo. Odoo applies dbfilter to that hostname to choose one PostgreSQL database and its filestore. Check that each hostname matches exactly one database, and that a request matching zero or several databases ends at the selector or an error, as your configuration dictates.

Hostname to database mapping in one Odoo request, with the selector fallback.

Security risks of sharing one Odoo instance across databases

Pointing several databases at one Odoo instance concentrates risk in a few places: the database manager, the master password, the shared filestore host and the patch cycle. The cards below cover what to check in each area, and the controls DeployOpen configures and tests are described in general terms.

Database manager exposure

The database manager lets anyone who reaches it list, create, duplicate, back up or drop databases on the instance. When several companies share one server, a reachable selector exposes every database name and gives an attacker a route to all of them. Once each hostname maps to one database, check that the selector is disabled with list_db = False and that the manager path is not published through the proxy. Confirm this from outside the network, not only in the config file.

Odoo on-premise docs

Master password handling

The admin_passwd value protects the database manager operations. Stored in plain text in odoo.conf, it is one secret that unlocks every database on the instance. Replace the default, keep the file readable only by the service account, and store the value in a secrets manager. Record who knows it and rotate it when someone with access leaves. Ask for the current value to be tested, not assumed.

Cross-company isolation on shared hosts

Databases on one instance share processes, the Python code base, the filestore root and the PostgreSQL server. A data leak in one database is possible through a shared path if filestore permissions or custom modules are not separated. Check that each database has its own filestore directory, that the database role for each company cannot see other databases, and that custom code from one client is not loaded by another. Confirm these points in the design before go-live.

Backups and restore testing per database

Each database needs its own dump and filestore backup, taken on a schedule that matches its business use. A shared server makes it easy to back up the host and assume every company is covered, yet restoring one company without touching the others requires a tested procedure. Restore one database into a separate host, check logins, records and attachments, and time the steps. Ask for the restore test record, not only the backup job schedule.

User access across databases

A single person who has an account in several databases can switch between companies with the same login if the credentials are shared or reused. Review which users exist in each database, remove inactive accounts, and check that administrator rights are not granted across companies by mistake. Where sign-in is delegated to LDAP or another provider, confirm that the user mapping is set per database. Access reviews should run for each database separately.

Patching one instance for all databases

A shared instance is patched once, so a missed update or a failed upgrade affects every company at the same time. Odoo standard support covers the first three years after a major release on Odoo Online, Odoo.sh and on-premise, and security patches are only provided during standard support. Plan each update against a staging copy of every database, track the support end date of the running version, and confirm who signs off before the production switch.

Standard support window
Three years
Odoo support docs

Blocking the database selector without breaking websites

Once every hostname maps to exactly one database, the database selector should be turned off, because it lets anyone who reaches the login page list and switch between the databases on the server. Odoo decides which databases a request may see through dbfilter, so a website served on a hostname that matches several databases, or none, will show the selector or fail to load. The safe sequence is to first confirm that each public hostname resolves to one database name through the %h or %d pattern (or an explicit --database list), then set list_db = False in odoo.conf and restart the service. Keep the master password and the database manager protected in the meantime, since disabling the list does not disable the manager page itself. Confirm the exact option names and behavior against the version you run, using the on-premise documentation linked from this page.

The trade-off is operational. A strict one-to-one mapping is easier to audit, because every hostname has a known database and no user can browse the rest, but each new company or environment then needs a DNS record, a reverse proxy entry and sometimes a filter change before it works. A looser pattern reduces that work but leaves more databases reachable through the same hostname logic. Decide which way you want the trade-off before go-live, and write the hostname-to-database table down so the next change is a reviewed edit rather than a guess. Ask whoever will run the platform how often new databases are expected, because that frequency decides how much of this change process you can afford to repeat.

After the change, test each database separately rather than checking one site and assuming the rest work. For every hostname, confirm that login succeeds and lands on the correct database, and that the Odoo administrator path still works for the staff who need it. Also check scheduled actions per database, since cron jobs run against each database that the server loads, and a database that falls outside the filter can stop sending email, syncing or running its reports without any visible error on the website. Record the results in a short checklist so that the next database added to the server goes through the same tests.

Limits to confirm before you share one instance

A shared Odoo instance puts several companies or environments behind one process pool, one upgrade cycle and one edition decision. Each card below is a check to run in your own environment, not a guarantee that the arrangement will work as you expect.

Exact dbfilter and list_db behavior

Confirm how your Odoo version resolves dbfilter and whether the database selector is shown when several databases match a request. Behavior around %h, %d and the --database list can differ between major versions, so test each pattern against the exact release you plan to run. Check the selector on every hostname before go-live, including the bare domain, staging names and any hostname that a reverse proxy forwards without rewriting.

On-premise docs

Edition and plan eligibility

Odoo's pricing page lists Odoo.sh and on-premise hosting only under the Custom plan, and only Custom includes multi-company. If your arrangement puts several companies in one database or depends on multi-company features, confirm the plan with Odoo before you design around it. Ask in writing whether your Enterprise subscription covers every database on the instance.

Odoo pricing

Resource use per database

Every database on the instance shares the same worker pool, memory and PostgreSQL connections. A busy production company can slow a quiet test database, and the reverse is also true when scheduled actions run across all databases. Measure concurrent users and cron load per database, then size workers for the combined peak rather than the average. Sizing guidance is in the server sizing topic.

Cross-database reporting limits

Odoo does not expose one database to another during normal operation, so consolidated reports across separate databases need an export, a data warehouse or a custom integration. Confirm with the vendor and your own tests what is possible inside one database, and decide early whether consolidation belongs in Odoo, in a separate analytics store or in a reporting tool you already operate.

Upgrades on a shared instance

Upgrades apply to the code that serves all databases, but each database carries its own data migration and its own test cycle. Odoo's documentation describes upgrading through an upgraded test database that should be tested before production. Plan one upgrade window for the instance, test every database copy, and confirm how custom modules and third-party add-ons behave on each one before the window opens.

Upgrade docs

Questions teams ask about dbfilter and hosting several databases

What drives the cost of hosting several Odoo databases on one server?

The main cost drivers are how many databases share the instance, how many hostnames and certificates sit in front of them, and how much custom code each database loads. Each company or environment needs its own DNS record, TLS certificate and proxy rule, so routing work grows with the hostname count. Differences in module sets or versions between databases add maintenance work because the team must track more than one configuration. Hosting costs and Odoo licensing are separate line items. Odoo's pricing page limits multi-company and custom module features to the Custom plan, so confirm which plan each database needs before scoping. Ask for a quote that lists the hostnames, the databases, the custom modules per database and whether staging copies are included.

How long does a multi-database Odoo setup take to configure?

Timing depends on how many databases exist, whether they already run, and how much of the environment is new. Adding a few databases to a working Odoo server is mostly proxy, DNS and testing work. Duration grows when databases must be created from scratch, when data migration is involved, when the team rehearses a cutover, or when DNS and certificate changes need approval from another department. Customer-facing websites add testing time because each hostname needs checks for login redirects, the database selector and form submissions. Ask for a schedule that shows the cutover window, the test pass for each hostname and the rollback step. Any database added now will also join the upgrade schedule later, so include that work in the timeline.

What does our team need to provide before a multi-database project starts?

The project needs several inputs from your side before work begins:

  • DNS control for every hostname that will serve a database, with a named owner for changes
  • A process to issue or renew TLS certificates for each hostname
  • Access to the reverse proxy configuration and the approval to reload it during a change window
  • An administrative account on the Odoo server and the database tier
  • A test environment with copies of each database, made with neutralization so that outgoing email and payment integrations cannot reach live systems, as described in Odoo's on-premise documentation
  • A named business owner for each database who signs off on testing

Identify these owners early, because DNS and certificate approvals are often the slowest part of the schedule.

Can an internal IT team set up dbfilter on its own?

Yes, if the team already runs Odoo behind a reverse proxy and understands how Odoo chooses a database from the request hostname. The filter setting itself is short, so the real risk sits in the surrounding parts: proxy headers, the Host header, session cookies, websocket routing and the way each database is created and tested. An internal team with a staging copy, prior Nginx experience and the time to test every hostname end to end can usually handle the work. A team without a test environment or a rollback plan should weigh an outside partner. Whoever does the work should document the final configuration so the next upgrade does not depend on one person.

When is a separate Odoo server a better choice than several databases on one?

A separate server fits better when databases need different isolation, different maintenance windows, different Odoo versions, or when load in one database affects the others. Databases on one instance share worker processes, memory and scheduled actions, so a heavy import in one company can slow down another. Separation also suits cases where a customer contract, an internal policy or a regulator expects one entity's data to run in its own application environment. A shared instance works well for related companies that share administrators, a release schedule and similar modules. Review the server sizing and the PostgreSQL separation decisions alongside this choice, since both affect how many databases one machine can carry.

How do upgrades work when several databases share one Odoo instance?

All databases on one instance run the same Odoo code, so a code upgrade moves every database together, but each database still needs its own data upgrade and testing. On Odoo Online and Odoo.sh, major version upgrades are mandatory every two years according to Odoo's upgrade documentation. On-premise upgrades through the upgrade service require an Enterprise subscription, and the Community edition has no access to that service. Plan a test copy for each database, check custom modules against the new version and order the databases by business risk. Keep the support window in mind as well: Odoo 17.0 standard support ended in September 2026, so older instances may need to move sooner than planned. Confirm the upgrade path with Odoo for your edition.

Why do customer websites break when several databases share one Odoo server?

Without a filter, Odoo can offer several databases for a request, and the wrong one may serve the website. That breaks sign-in, page routing and form submissions on customer sites. A dbfilter pattern tells Odoo which database a hostname should use, so each domain resolves to one database. The pattern %h matches the full hostname, while %d matches the first part of it, so choose the pattern that fits your DNS naming. The filter depends on the Host header your proxy passes through, so a proxy that rewrites that header will cause mismatches. Test every domain after each change, including the redirects that Odoo issues after login.

How DeployOpen scopes and delivers a multi-database Odoo setup

DeployOpen treats a multi-database Odoo host as a routing and access design before it is a server build. We agree which companies or environments share one instance, how each hostname maps to one database, and how the database selector is handled, then build and test that mapping in the client's own infrastructure. The result is a documented setup the client's own team can operate.

How we scope

  • Engagements are fixed-scope, with the database list, hostname map and environments agreed in writing before work starts.
  • We inventory which companies, staging copies and websites share the instance, and which hostnames each one answers to.
  • The written scope states whether the database selector will be blocked, and what the client must confirm about DNS and reverse proxy routing.

How we build

  • We configure dbfilter patterns and the database list in the Odoo configuration, then test each hostname against its intended database.
  • We set up reverse proxy host headers and check that websites resolve to the correct database without a database selector prompt.
  • We test that a request for an unknown hostname is refused, and that every database still opens for its own users after the change.

How we hand over

  • Handover includes the final configuration, the hostname-to-database map and the test results for each environment.
  • We document how to add a new database or hostname, including the steps for a test copy and its neutralized data.
  • Client staff are walked through the runbook so changes to the database list follow the same tested process.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, which can cover new databases added after go-live.
  • Retests are run after Odoo version upgrades or proxy changes, since routing behavior can shift with either.
  • Ask any partner to confirm in writing how dbfilter changes, database backups and access reviews will be handled after handover.

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.