React hosting guide

How to deploy a React app

Start by identifying whether your React project is a static app, a framework app, or a full-stack service. That choice determines the hosting model.

Recommended starting point: Cloudflare Workers or Vercel

What matters most

For a Vite or Create React App style project, the production artifact is usually a static directory. Hosts only need to serve HTML, JavaScript, CSS, and assets with correct cache behavior.

For Next.js, Remix, or React Router framework mode, check whether your app needs server rendering, image optimization, API routes, middleware, or only a static export.

Before changing DNS, run the production build locally, preview the output, verify environment variables, and test a direct visit to every important URL.

Deployment steps

  1. Run the project build command and record the output directory.
  2. Preview the production output locally instead of relying on the dev server.
  3. Configure redirects, headers, and 404 behavior before pointing the domain.
  4. Deploy to the host, attach the custom domain, then verify canonical URLs and analytics.
  5. Submit the sitemap in Search Console after the replacement site is live.

Related React hosting guides