Skip to Content

Contributors

Multi Tenant Self Hosted Enviroments

Greetings,

      I have been struggling to set up a multi-tenant, self hosted
Odoo environment.   The purpose of multi-tenant in my deployment, I am
referring to having multiple clients, who will each want to "own" and
manage their instance / database of Odoo.   That is, being able to set
up multiple websites, shops, with consolidated invoicing and services
already provided by Odoo.

      I understand that I can set up separate VMs which would each
point to a specific database.   But it would require additional
resources to deploy each VM to maintain the OS instances required.
As a result, I am looking to consolidate the deployments as much as
possible.   This way I can configure clients and then break them out
if/when it's needed.

     I am running Odoo 16, self hosted.   I started to go down the
path to try and force clients to use their specific domain name, but
that became an issue because dbfilter can associate between a fully
qualified hostname, or just the hostname itself.   It wasn't built to
go the other direction.   Then I ran into the problem of a client
needing to use multiple domains and how to associate them to their
respective databases.   I tried to do much of this logic within nginx,
but even then I ran into problems with modifying HTTP headers and then
losing the desired outcome.

     Does anybody know if I'm missing something, or would I really
have to kickoff an Odoo instance for each client with their own
distributed TLS/SSL cert, DB and front-end server ?   I would really
like to find a solution that would scale and I know a lot of people
have made it scale.  I'm just missing some pieces to do the same.

Thank you,
Charles

by cgucker - 07:46 - 20 May 2023

Follow-Ups

  • Re: Multi Tenant Self Hosted Enviroments
    I am all in on Terraform/AWS and I never surface the control plane at all. An isolated container pipeline creates a new database, then an internet-accessible ECS cluster provides access to it (with the control plane disabled).

    On Mon, May 22, 2023 at 5:52 AM Xavier Brochard <notifications@odoo-community.org> wrote:
    Le 21.05.2023 23:32, Charles Gucker a écrit :
    
    
    > On Sun, May 21, 2023 at 12:22 PM Xavier Brochard
    
    
    >> In case Cloudpepper is not what you want, Ivan Yelizariev has made a
    
    
    >> package to help multi tenant Odoo hosting (see its modules on
    
    
    >> apps.odoo.com). There is also some bash scripts from the french 
    
    
    >> provider
    
    
    >> Sisalp that you can download from http://download.sisalp.net/scripts/.
    
    
    >> You might also use the Yunohost solution, there is a good Odoo package
    
    
    >> (any version).
    
    
    > Thank you, I'm going to dig into the scripts.  I also took a look at
    
    
    > Yunohost and it seems a little basic based on my background and
    
    
    > experiences.
    
    Yunohost is not so basic : while its purpose is to help beginners to 
    self-host, it is also good if you want to not forget something, start 
    with all annoying tasks done automaticaly and save time, as it is 
    complete and well configured. **And you can allways do what you want 
    with it.**
    It is also good if you need to try Odoo with Etherpad, NextCloud, 
    LibreOffice, etc.
    
    
    
    > I'm
    
    
    > trying to understand how Odoo got to the point of multi-domain (being
    
    
    > able to add multiple websites) in the data plane, but not breaking
    
    
    > away the control plane (configuration functions) from the remaining
    
    
    > data plane functions.  That is, dbfilter is intended to assign a
    
    
    > specific host or FQDN to facilitate the control plane functions, but
    
    
    > there isn't a function to administrate the relationships with the data
    
    
    > plane.  In other words, within Odoo, there is no way to dynamically
    
    
    > maintain a list of vhost domains and associate them with their
    
    
    > respective databases and actually see the state of each vhost as they
    
    
    > relate to their database and mark them as active or inactive, which
    
    
    > would allow for the duplications or migrations from one database to
    
    
    > another without collisions.
    
    Don't forget to have a look on Yelizariev solution. You can ask him if 
    you don't find his modules.
    There was also some useful OCA modules in the past.
    
    
    
    >  I too ran a service provider in the early 90s
    
    Sometimes I miss this pleasant time, when there was a lot of new things 
    to invent !
    
    Best
    Xavier
    
    

    _______________________________________________
    Mailing-List: https://odoo-community.org/groups/contributors-15
    Post to: mailto:contributors@odoo-community.org
    Unsubscribe: https://odoo-community.org/groups?unsubscribe


    by Adam Heinz - 05:00 - 22 May 2023
  • Re: Multi Tenant Self Hosted Enviroments
    Le 21.05.2023 23:32, Charles Gucker a écrit :
    
    > On Sun, May 21, 2023 at 12:22 PM Xavier Brochard
    
    >> In case Cloudpepper is not what you want, Ivan Yelizariev has made a
    
    >> package to help multi tenant Odoo hosting (see its modules on
    
    >> apps.odoo.com). There is also some bash scripts from the french 
    
    >> provider
    
    >> Sisalp that you can download from http://download.sisalp.net/scripts/.
    
    >> You might also use the Yunohost solution, there is a good Odoo package
    
    >> (any version).
    
    > Thank you, I'm going to dig into the scripts.  I also took a look at
    
    > Yunohost and it seems a little basic based on my background and
    
    > experiences.
    
    Yunohost is not so basic : while its purpose is to help beginners to 
    self-host, it is also good if you want to not forget something, start 
    with all annoying tasks done automaticaly and save time, as it is 
    complete and well configured. **And you can allways do what you want 
    with it.**
    It is also good if you need to try Odoo with Etherpad, NextCloud, 
    LibreOffice, etc.
    
    
    > I'm
    
    > trying to understand how Odoo got to the point of multi-domain (being
    
    > able to add multiple websites) in the data plane, but not breaking
    
    > away the control plane (configuration functions) from the remaining
    
    > data plane functions.  That is, dbfilter is intended to assign a
    
    > specific host or FQDN to facilitate the control plane functions, but
    
    > there isn't a function to administrate the relationships with the data
    
    > plane.  In other words, within Odoo, there is no way to dynamically
    
    > maintain a list of vhost domains and associate them with their
    
    > respective databases and actually see the state of each vhost as they
    
    > relate to their database and mark them as active or inactive, which
    
    > would allow for the duplications or migrations from one database to
    
    > another without collisions.
    
    Don't forget to have a look on Yelizariev solution. You can ask him if 
    you don't find his modules.
    There was also some useful OCA modules in the past.
    
    
    >  I too ran a service provider in the early 90s
    
    Sometimes I miss this pleasant time, when there was a lot of new things 
    to invent !
    
    Best
    Xavier
    
    

    by xavier - 11:51 - 22 May 2023
  • Re: Multi Tenant Self Hosted Enviroments
    Let me respond inline.
    
    On Sun, May 21, 2023 at 12:22 PM Xavier Brochard
    <notifications@odoo-community.org> wrote:
    
    >
    
    > In case Cloudpepper is not what you want, Ivan Yelizariev has made a
    
    > package to help multi tenant Odoo hosting (see its modules on
    
    > apps.odoo.com). There is also some bash scripts from the french provider
    
    > Sisalp that you can download from http://download.sisalp.net/scripts/.
    
    > You might also use the Yunohost solution, there is a good Odoo package
    
    > (any version).
    
    Thank you, I'm going to dig into the scripts.   I also took a look at
    Yunohost and it seems a little basic based on my background and
    experiences.   I'm not adverse to getting my hands a little dirty, I
    just didn't want to recreate the wheel with my own efforts.
    
    I've been giving my original question some additional thought.   I'm
    trying to understand how Odoo got to the point of multi-domain (being
    able to add multiple websites) in the data plane, but not breaking
    away the control plane (configuration functions) from the remaining
    data plane functions.   That is, dbfilter is intended to assign a
    specific host or FQDN to facilitate the control plane functions, but
    there isn't a function to administrate the relationships with the data
    plane.   In other words, within Odoo, there is no way to dynamically
    maintain a list of vhost domains and associate them with their
    respective databases and actually see the state of each vhost as they
    relate to their database and mark them as active or inactive, which
    would allow for the duplications or migrations from one database to
    another without collisions.
    
    I am aware that I am drifting into the core components of Odoo, but if
    there was a way to assign a specific "control plane domain", the
    dbfilter could be used just on that domain to facilitate control plane
    functionality, while all of the data plane functionality would be
    presented within the GUI and dynamically serve the active domains
    without having to be handled by the dbfilter.   This would allow
    central administration via the tenant_name.mycontrolplane.com, while
    allowing all of their configured domains, provided there are no
    conflicts with other tenants would not be subject to the dbfilter.
    It would make the reverse proxy configuration a lot easier as well, as
    all queries would just be forwarded and no domain specific
    configurations would be required.     Is this line of thinking
    correct, or am I missing something?   Also, if this functionality
    existed, a multi-tenant setup would be able to be accomplished without
    the need to do any external tinkering from Odoo, except for the TLS
    certificates, but there's a module for that.
    
    
    > But beware, self-hosting require work. While it's easy for personal
    
    > projects, it require a lot of time when it comes professional. I ran a
    
    > hosting company in the 90's, I know what I am talking about. I didn't
    
    > knew about Cloudpepper, but it looks very good.
    
    I am very well aware of the work required to perform self-hosting
    functions.   I too ran a service provider in the early 90s and evolved
    to run the platform engineering team for a large scale digital
    advertising provider.   I'm not afraid of automation or
    orachistration, but only when absolutely needed.   If we can fix my
    concerns within the application, it would require a lot less of an
    effort to administrate.   Personally, if things went this well, I'd
    rather put my time and effort into scaling with a CDN provider than
    continue to tinker with Odoo's current lack of control plane
    scalability.
    
    For the time being, I'm going down the path of a single tenant per
    instance, but once I get this not for profit setup, I'll return into
    figuring out what is required to resolve what I see as a control plane
    issue without removing existing functionality.
    
    Thank you again for your recommendations, it's much appreciated.
    
    Charles
    

    by cgucker - 11:31 - 21 May 2023
  • Re: Multi Tenant Self Hosted Enviroments
    In case Cloudpepper is not what you want, Ivan Yelizariev has made a 
    package to help multi tenant Odoo hosting (see its modules on 
    apps.odoo.com). There is also some bash scripts from the french provider 
    Sisalp that you can download from http://download.sisalp.net/scripts/. 
    You might also use the Yunohost solution, there is a good Odoo package 
    (any version).
    
    But beware, self-hosting require work. While it's easy for personal 
    projects, it require a lot of time when it comes professional. I ran a 
    hosting company in the 90's, I know what I am talking about. I didn't 
    knew about Cloudpepper, but it looks very good.
    
    
    ---
    Librement,
    Xavier Brochard xavier@alternatif.org
    La liberté est à l'homme ce que les ailes sont à l'oiseau
    (Jean-Pierre Rosnay)
    
    Le 20.05.2023 19:47, Charles Gucker a écrit :
    
    > Greetings,
    
    > I have been struggling to set up a multi-tenant, self hosted
    
    > Odoo environment.  The purpose of multi-tenant in my deployment, I am
    
    > referring to having multiple clients, who will each want to "own" and
    
    > manage their instance / database of Odoo.  That is, being able to set
    
    > up multiple websites, shops, with consolidated invoicing and services
    
    > already provided by Odoo.
    
    > I understand that I can set up separate VMs which would each
    
    > point to a specific database.  But it would require additional
    
    > resources to deploy each VM to maintain the OS instances required.
    
    > As a result, I am looking to consolidate the deployments as much as
    
    > possible.  This way I can configure clients and then break them out
    
    > if/when it's needed.
    
    > I am running Odoo 16, self hosted.  I started to go down the
    
    > path to try and force clients to use their specific domain name, but
    
    > that became an issue because dbfilter can associate between a fully
    
    > qualified hostname, or just the hostname itself.  It wasn't built to
    
    > go the other direction.  Then I ran into the problem of a client
    
    > needing to use multiple domains and how to associate them to their
    
    > respective databases.  I tried to do much of this logic within nginx,
    
    > but even then I ran into problems with modifying HTTP headers and then
    
    > losing the desired outcome.
    
    > Does anybody know if I'm missing something, or would I really
    
    > have to kickoff an Odoo instance for each client with their own
    
    > distributed TLS/SSL cert, DB and front-end server ?  I would really
    
    > like to find a solution that would scale and I know a lot of people
    
    > have made it scale. I'm just missing some pieces to do the same.
    
    > Thank you,
    
    > Charles
    
    > 
    
    > _______________________________________________
    
    > Mailing-List: https://odoo-community.org/groups/contributors-15 [1]
    
    > Post to: mailto:contributors@odoo-community.org
    
    > Unsubscribe: https://odoo-community.org/groups?unsubscribe [2]
    
    > 
    
    > 
    
    > 
    
    > [1] https://odoo-community.org/groups/contributors-15
    
    > [2] https://odoo-community.org/groups?unsubscribe
    

    by xavier - 06:20 - 21 May 2023
  • Re: Multi Tenant Self Hosted Enviroments
    Hi Charles,

    You can host several instances on the same server, it's not limited to one instance / server. On the server they each have their own environment.

    We also support multi-domain on the same instance.

    Feel free to email me directly for more info.

    Best regards
    Sven 


    Op za 20 mei 2023 21:37 schreef Charles Gucker <notifications@odoo-community.org>:
    Sorry for the extra noise, but I should have looked at the cloudpepper
    solution a little closer before responding.   CPs approach is to
    manage multiple server instances on disparate cloud providers, I am
    looking to consolidate the functionality to a single cluster of
    servers and not deploy a unique server per client.   I could do a lot
    of the same type of functionality by making use of Terraform providers
    and ansible or alternatively make use of multiple Docker containers,
    but a lot of the core functionality that I am looking for already
    exists within Odoo.   I'm just trying to find out if somebody else has
    already harnessed it to perform multiple tenant deployments within the
    same Odoo instance.
    
    Thank you,
    Charles
    
    On Sat, May 20, 2023 at 2:21 PM Charles Gucker <cgucker@onestep.net> wrote:
    
    
    >
    
    
    > Let me respond inline.
    
    
    >
    
    
    > On Sat, May 20, 2023 at 2:02 PM Sven from Cloudpepper
    
    
    > <notifications@odoo-community.org> wrote:
    
    
    > >
    
    
    > > Hi Charles,
    
    
    > >
    
    
    > >
    
    
    > > Perhaps you can give our services a try?
    
    
    > > You can host as many Odoo instances (Community and Enterprise) on a server as you want, all automated.
    
    
    > > Also gives you test environments, GitHub deployment and automated backups.
    
    
    > > It also has the OCA marketplace built-in, so you can easily activate any OCA module on an instance.
    
    
    >
    
    
    > Yes, this is in short what I want to be able to provide to my clients,
    
    
    > but directly as in self-hosted.   Glad to see that somebody has done
    
    
    > it.
    
    
    >
    
    
    > > We can also give clients access to your own branded dashboard so they can see and manage their instances (ie. see the logs, restart, create a backup, etc.)
    
    
    >
    
    
    > Would love to better understand the approach your company took to
    
    
    > achieve the multi-tenant design of Odoo.   Just to be clear, I would
    
    
    > not be making any offers to the general public, unless tied to a brick
    
    
    > and mortar offering.
    
    
    >
    
    
    > Charles
    

    _______________________________________________
    Mailing-List: https://odoo-community.org/groups/contributors-15
    Post to: mailto:contributors@odoo-community.org
    Unsubscribe: https://odoo-community.org/groups?unsubscribe


    by Sven - 08:51 - 20 May 2023