Skip to content

Vercel for Platforms

Build platforms that serve multiple customers from a single codebase. Each customer gets its own domain or subdomain, while you keep one deployment, one set of branding, and one place to ship updates.
middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
 
export function middleware(req: NextRequest) {
  // Route each tenant's subdomain to a shared dynamic segment
  const host = req.headers.get('host') ?? '';
  const tenant = host.split('.')[0];
 
  return NextResponse.rewrite(
    new URL(`/tenants/${tenant}${req.nextUrl.pathname}`, req.url),
  );
}

Most platforms on Vercel follow one of two patterns. Pick the one that matches how isolated each customer needs to be:

ApproachCodebase and deploymentComplexityBest for
Multi-tenantOne codebase, one deployment serves every tenantLowerContent and branding differ, but functionality is the same (documentation sites, website builders, SaaS dashboards)
Multi-projectOne project and deployment per tenantHigherEach tenant needs custom code or isolated infrastructure (AI coding platforms, user-generated apps)

For a multi-tenant build, clone the Platforms Starter Kit. For a multi-project build, create and deploy tenant projects with the Vercel SDK.

Teams run many kinds of platforms on Vercel:

A typical setup gives you a root domain for your platform (acme.com), subdomains for tenants (tenant1.acme.com), and fully custom domains for customers who want them (tenantcustomdomain.com).

  • Unlimited custom domains and *.yourdomain.com subdomains.
  • Automatic SSL. Vercel issues and renews certificates for every tenant domain.
  • Programmatic domain management through the REST API or the Vercel SDK.
  • Global low-latency routing over the Vercel CDN and Anycast network.
  • Preview deployments so you can test tenant changes before they ship.
  • Support for 35+ frontend and backend frameworks.

Was this helpful?