# Can two Discourse Instances share and use One Database?

**URL:** https://meta.discourse.org/t/can-two-discourse-instances-share-and-use-one-database/320974
**Category:** Support
**Created:** [August 9, 2024, 7:51pm UTC](https://meta.discourse.org/t/can-two-discourse-instances-share-and-use-one-database/320974 "2024-08-09T19:51:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![oga](https://avatars.discourse-cdn.com/v4/letter/o/f19dbf/32.png) [@oga](https://meta.discourse.org/u/oga)
#### Post date: [August 9, 2024, 7:51pm UTC](https://meta.discourse.org/t/can-two-discourse-instances-share-and-use-one-database/320974/1 "2024-08-09T19:51:10Z")

</div>

I have been asked this question.  
Can Two separate Discourse Instances share and use the same Database.  
Scenario:  
One Company that has global Offices locations.  
Office and Location 1 named COMPANY [Foobu.Foobu.com](http://Foobu.Foobu.com) is located in Country X  
Office and Location 2 named COMPANy [Foobu.Foobull.com](http://Foobu.Foobull.com) is location in Country Y.  
REASON FOR THIS:  
Company 1 is the RESEARCH unit located here in Home country.  
COMPANY 2 is Support Unit located Outside home country.

They don’t want the folks Outside the Home Country to read what’s being shared in the Research unit.  
If this is not possible, as I don’t think it is; how do you suggest I explain this other than lengthy Technical stuff they may not understand …anyway.?

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [August 9, 2024, 8:15pm UTC](https://meta.discourse.org/t/can-two-discourse-instances-share-and-use-one-database/320974/2 "2024-08-09T20:15:53Z")

</div>

This has been asked many times. Please try to use search before posting new support topics. Thank you 🙏 🙂

> [@Use the same user database and login credentials in multiple discourse instances](https://meta.discourse.org/t/use-the-same-user-database-and-login-credentials-in-multiple-discourse-instances/45584/):
>
> I know that it is possible to run multiple instances of discourse on the same server using a multisite setup. I’m wondering if it would be possible for multiple instances of discourse to make use of the same user database? So that a user could sign-up on any one of several different forums and use those same credentials to log in to all of the others. If a user’s whole profile (trust level, profile detail, pictures, etc) could be synced across each instance, this would be ideal for our use-case. …

> [@Question: Different forums same users?](https://meta.discourse.org/t/question-different-forums-same-users/133757):
>
> Would it be possible to use the same SQL and same cookies across domains? For example, having the same users for [example.com](http://example.com) and [example.org](http://example.org) but different discourse installation?

SSO [Discourse Connect](https://meta.discourse.org/t/13045?silent=true) topic:

> [@Use Discourse as an identity provider (SSO, DiscourseConnect)](https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974):
>
> So you want to use Discourse as an identity provider for your own web app? Great! Let’s get started. Enable [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider setting Under Discourse admin site settings (/admin/site\_settings) enable setting enable discourse connect provider and add a secret string to discourse connect provider secrets (used to hash SSO payloads). Implement [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) in your web app: Generate a random [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce). Let’s call this value NONCE. Save it temporarily so that you can verify it with the …

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [September 8, 2024, 8:16pm UTC](https://meta.discourse.org/t/can-two-discourse-instances-share-and-use-one-database/320974/3 "2024-09-08T20:16:41Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
