Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to set default database for anonymous user?

Damian Bere
on 6/5/16, 9:11 AM 1,502 views

Simple requirement:  When an anonymous user visits the website, I want it to default to a specific website/database so they don't have to choose the database before even seeing the site... which is a really bad experience, clearly.

However, I do want to have multiple databases that can be selected by users of Odoo when they log in (or are identified by the domain name used). 

I have tried setting the db_name in the configuration, which has no effect, other than to provide a default for module installations etc.

I have tried setting the dbfilter, as follows:


 - This correctly selects the exact db, but hides all the others from the selector, and is not dynamic based on domain name, therefore I am really stuck with a single DB with this approach.

dbfilter=^%h$  (which is supposed to be the variable for the full host.domain.tld name)

 - This just does not work.  I have set my db name as:  domainname, domainname.tld (exactly as it appears in the browser) and domainname-tld (as per some tip in a community thread on this topic).  In every case, it asks me to create a new database. 

As I have a naked/bare domain (no www) I cannot use the %d variable, as this only provides the hostname part of the domain name.

I am using nginx and hosting odoo inside a docker container - the nginx proxy pass info set as such:

proxy_set_header X-Forwarded-Host $host;

proxy_set_header X-Forwarded-Server $host;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://prod-odoo:8069/;

So, I assume I am passing the hostname correctly. 

There appears no other way to make this work, but suggestions welcome.

Can you confirm a) is this possible, b) have I got my configuration correct, or c) is this a bug?


Does anyone have any thoughts on this?  

Damian Bere
on 6/13/16, 9:53 AM
Michel Antonise
On 10/24/16, 4:46 AM

Hi Damian,

Did you find a way around this? I'm facing a similar issue.


Hi Michel,

Unfortunately, no. I assume this is not possible in Odoo 9, despite it seeming like it should be, based on how that functionality is described. We will be rolling out Odoo 10 soon, so will check to see if this works in the latest release.

If you do figure out how to get it to work, I'd love to hear about it :)



Damian Bere
on 10/24/16, 7:01 AM

After consulting Odoo, it turns out our approach is wrong and I was asking the wrong questions.

We are still in the start-up fase, but the multiple DB issue was already raising a lot of questions.

We have a test copy of our production DB on our production server.

Causing new users having to choose their DB, which we wanted to avoid.

The solution, as simple as it is logical : we should have only 1 database on the production server.

Looking back on this, I can’t see how I missed this.

There are a million reasons why you would want an isolated production environment, without testing stuff on it.

I guess, we got blind sighted because it is so simple to create a duplicate of the production DB and use the copy as a “production like test”.

I hope you can get a solution for your question.



United Experts cvba, Michel Antonise
on 10/24/16, 7:56 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 6/5/16, 9:11 AM
Seen: 1502 times
Last updated: 10/24/16, 5:23 AM