zach.codes

Share this post

User's avatar
zach.codes
Multi Tenancy in Remix
Copy link
Facebook
Email
Notes
More

Multi Tenancy in Remix

All you need is a little express...

Zach Silveira's avatar
Zach Silveira
Nov 05, 2022
∙ Paid

Share this post

User's avatar
zach.codes
Multi Tenancy in Remix
Copy link
Facebook
Email
Notes
More
9
Share

So I’ve been tearing my hair out the past week because I’m building a project using Remix in my free time, and it doesn’t support multi-tenancy.

So what exactly is multi-tenancy?

It’s the ability to serve multiple domains from a single app.

Essentially my app is a website builder. So the builder is on my domain. Clients will sign up and point their own domain to the app. I will also host their pages on theirname.myapp.com.

The problem with this is, I need a marketing page on myapp.com. Then i need completely different code if the domain is clientsite.com.

In remix you can check the HTTP host header and render different things, but this is not ideal. If my app has `routes/about.tsx` I want the client to be able to have their own `about` page.

I don’t want to check the host header in my routes and then make a mess of the code.

Not only that, but you will end up bloating your JS bundle with internal app code vs client page code.

How to do it

Let’s just jump right into how I made this happen in …

Keep reading with a 7-day free trial

Subscribe to zach.codes to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Zach Silveira
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More