Deploy Your Nhost Frontend

Nhost runs your backend. ZeroDeploy hosts your frontend. No overlap.

Last updated: February 20, 2026

How it works

Nhost backend + ZeroDeploy frontend.

Nhost provides a Postgres database with a Hasura GraphQL API, authentication, storage, and serverless functions in their cloud. Your frontend — a React, Vue, or Next.js SPA — is hosted on ZeroDeploy and queries Nhost's GraphQL endpoint at runtime. Static frontend on the edge, GraphQL backend in Nhost.

Deploy in 3 steps

From zero to live in under a minute.

1

Create your frontend project

Scaffold a new project with Vite. Add the Nhost SDK and connect it to your backend.

bash
npm create vite@latest my-app -- --template react-ts
2

Build for production

Run the build command to generate static output in dist/.

bash
cd my-app && npm run build
3

Deploy to ZeroDeploy

One command to push your frontend to the edge. It's live in seconds.

bash
zerodeploy deploy --dir dist

Configuration tips

Connecting your frontend to Nhost.

  • Store your Nhost subdomain and region as environment variables: VITE_NHOST_SUBDOMAIN and VITE_NHOST_REGION.
  • Initialize the Nhost client: new NhostClient({ subdomain: import.meta.env.VITE_NHOST_SUBDOMAIN, region: import.meta.env.VITE_NHOST_REGION }).
  • For React apps, wrap your app with <NhostProvider nhost={nhost}> to enable auth hooks and the Nhost Apollo client.

Things to know

Nhost-specific tips to avoid common pitfalls.

  • Nhost's GraphQL endpoint requires authentication for protected queries. Make sure your Hasura permissions are configured correctly — public queries don't need auth, but protected data needs the user's session token.
  • If using Nhost Auth with redirect-based sign-in, add your ZeroDeploy URL to the allowed redirect URLs in your Nhost dashboard.
  • For SPAs with client-side routing, create a public/_redirects file with /* /index.html 200. Learn more about redirects →
  • Nhost Functions run on Nhost's infrastructure. They work regardless of where you host your frontend — no configuration changes needed on ZeroDeploy.

Everything you need

Host your Nhost frontend with the features you'd expect from a modern hosting platform.

Instant Deploys

Push to deploy in under 5 seconds. No queues, no build minutes to worry about.

Preview URLs

Every deployment gets a unique URL. Share any version instantly with your team.

Custom Domains

Connect your own domain with automatic SSL. Just add a CNAME and you're live. Learn more →

GitHub Actions CI/CD

Deploy on every push with GitHub Actions. Get PR comments with preview URLs. Set up CI/CD →

Built-in Analytics

See traffic, top pages, referrers, and countries right in your dashboard. No third-party scripts. Learn more →

Forms That Just Work

Add action="/_forms/contact" to any form. Submissions appear in your dashboard. Learn more →

Frequently asked questions

Can I use Nhost with ZeroDeploy?

Yes. ZeroDeploy hosts your frontend while Nhost runs your backend (Postgres, GraphQL, auth, storage). Your SPA connects to Nhost's API at runtime — ZeroDeploy serves the static files.

Does GraphQL work from a static site?

Yes. GraphQL queries run from the browser at runtime. Your ZeroDeploy-hosted SPA sends GraphQL requests to Nhost's endpoint the same way it would from any host. No server-side rendering needed.

Why use ZeroDeploy instead of Nhost's built-in hosting?

ZeroDeploy offers built-in forms and privacy analytics that Nhost's hosting doesn't include. If you want a simpler, CLI-first deploy workflow with extras like forms and analytics, ZeroDeploy adds value beyond basic hosting.

Do Nhost Functions work with ZeroDeploy?

Yes. Nhost Functions run on Nhost's infrastructure, independent of where your frontend is hosted. Your ZeroDeploy-hosted SPA calls Nhost Functions via HTTP — no server-side setup needed.

Also works with

ZeroDeploy hosts frontends for any backend-as-a-service.

Framework deploy guides

Deploy your Nhost frontend in seconds

GraphQL backend on Nhost. Static frontend on ZeroDeploy. A modern full-stack without the complexity.