Self-hosting Discourse for a Canadian community: keeping data and backups in Canada

We help a few Canadian organisations run their own community forums, and a recurring request is that member data never leaves the country. Discourse makes most of this straightforward, but there are a few places where data can quietly end up elsewhere. Here is the checklist we use when planning a self-hosted install for a client with Canadian data residency requirements:

  1. Server location: pick a VPS or dedicated server physically in a Canadian data centre (Vancouver, Toronto or Montreal) and confirm it in writing with the provider.
  2. Backups: point automatic backups at S3-compatible storage hosted in Canada rather than the default region of a large cloud provider.
  3. Uploads: if you move uploads to object storage, make sure the bucket and any CDN origin are also in Canada.
  4. Outgoing mail: choose an SMTP provider that processes mail in Canada, or at least document where it is handled.
  5. Third-party plugins and integrations: review analytics, translation and AI plugins, since they often send content to servers outside the country.
  6. Logs and monitoring: keep log shipping and uptime monitoring in-region too.

For those of you running Discourse for Canadian (or EU) communities, what else do you check? Has anyone found a clean way to handle CDN caching without data leaving the country?

1 Like

Handling CDN globally such way that data never leaves EU or Canada breaks the idea of CDN aka. using geographically closest datacenter.

Staying inside Canada, or for me EU, is quite easy task when using enterprises that aren’t USA, China, Russia etc. connected. Meaning ie. I don’t trust Amazon/AWS at all.

[what CDCK does]

For our locale-specific hosting (CA/US/EU) we store content in that locale, but CDN endpoints worldwide can cache it upon request [excepting specific negotiated terms to the contrary].

[not an official statement from CDCK, but personal opinion]

This sort of request feels very pie-in-the-sky to me - as much as I’m for data sovereignty, preventing ANY data from leaving the country without a complete geolock on access just isn’t feasible. If someone outside the country accesses your site… the data has left the country. Do you also block all user access from outside the country? That’s the only way to have it.

If not, why is caching outside the country a problem? What’s the actual goal?

Depending on CDN provider, opting not to cache on CDN endpoints outside the country is possible, so if you really want to do it, go ahead.

If it’s sensitive PII you’re concerned about, that data doesn’t traverse the CDN. If it’s UGC (uploads, etc.), secure uploads can be enabled.

1 Like

You know very well that there is big difference if we are talking about keeping all data in a datacenter that is regulated ie. US government or in user’s device.