tutorial March 15, 2026 2 min read

How to Run 100 Websites from a Single Deployment

Learn the multi-tenant architecture pattern that lets you serve hundreds of websites from one Cloudflare Worker deployment.

0

What if adding a new website to your portfolio took 30 seconds instead of 30 minutes? No new repo, no CI/CD pipeline, no deployment. Just a database entry and a DNS record. That is multi-tenant hosting.

The Architecture

Multi-tenant web hosting means one application serves multiple tenants (sites). Each tenant gets a unique experience — different domain, brand, content, and features — but they all run on the same infrastructure.

The key insight: the hostname IS the routing key. When a request comes in for bankstatementtoexcel.co, the same Worker that handles llctax.co looks up the hostname, fetches the right configuration, and renders the correct site.

Step 1: Domain-Based Routing

Every request starts with hostname extraction. Strip www, normalize to the bare domain, and use it as a lookup key in your database. This single query returns everything: brand name, colors, template type, feature flags, and navigation.

Step 2: Template System

Each site has a template type: blog, tool, SaaS, directory, or newsletter. The template determines the layout and available features. Within each template, homepage sections are configured per-site — a tool site might have a hero, converter widget, trust signals, and FAQ. A blog site might have a featured posts grid and category navigation.

Step 3: Content from Database

Blog posts, directory entries, and custom pages live in a shared database (Cloudflare D1), partitioned by site_id. The sitemap generator queries for all published content for that specific site. No build step needed — content changes are live immediately.

Step 4: Edge Caching

Site configuration is cached in-memory per Worker isolate (typically 60 seconds). This means the first request after a cold start does one database query, and subsequent requests are served from memory. At Cloudflare edge, this means sub-50ms responses globally.

Real Numbers

Pages Plus currently serves 20+ sites from a single deployment. Adding a new site requires: one D1 insert for the site config, one CNAME DNS record, and one Pages custom domain registration. Total time: under 60 seconds.

When NOT to Use Multi-Tenant

If each site needs fundamentally different functionality (not just different content/branding), you need separate deployments. Multi-tenant works best when sites share a common architecture but differ in content and presentation.

Was this article helpful? Thanks for your feedback!
architecturemulti-tenantcloudflarescalability

Enjoyed this article?

Get more insights like this delivered to your inbox.

? shortcuts·⌘K search