Host multiple Clerk apps on the same domain

Category
Product
Published

We are thrilled to introduce a highly anticipated feature that allows multiple applications to be hosted under the same domain.

Previously, Clerk only supported hosting one application per domain without causing cookie collisions and this limitation forced our users into a handful of unacceptable workarounds. So, we went back to the drawing board and rearchitected the way we set and handle our cookies to finally support multiple apps under the same domain.

Now, cookies are more tightly scoped, enabling useful scenarios like:

  • Staging and production environments on the same domain: No more need to buy a separate domain just to set up a staging environment. Your production environment can live at example.com, and your staging app can live at staging.example.com.

  • Separate apps, same TLD: Some customers had multiple apps but wanted to keep the top-level domain consistent. Enable a scenario like dashboard.example.com and admin.example.com without needing a separate domain.

  • Developing multiple apps on localhost at the same time: You can now develop multiple applications on localhost simultaneously using different ports (e.g., on localhost:3000 and localhost:3001) out of the box.

The best part is, there’s no need to make any changes to your applications - everything works out of the box. Just ensure your Clerk SDKs are up to date to fully leverage this feature. We’ve been rolling out this change gradually over the past few weeks and have done the heavy lifting to ensure everything runs seamlessly.

There are even more improvements to come as it relates to enabling best-in-class deployment workflows (cough staging instances cough), and this foundational change gets us a step closer to that reality.