Deploy Your PocketBase Frontend
PocketBase is your backend in a single file. ZeroDeploy is your frontend in a single command.
Last updated: February 20, 2026How it works
PocketBase backend + ZeroDeploy frontend.
PocketBase runs as a single binary on your server (VPS, Railway, Fly.io, etc.), providing a REST and real-time API. Your frontend — a React, Vue, or Svelte SPA — is hosted on ZeroDeploy and connects to your PocketBase instance's URL at runtime. Static frontend on the edge, backend on your server.
Deploy in 3 steps
From zero to live in under a minute.
Create your frontend project
Scaffold a new project with Vite. Add the PocketBase SDK and connect it to your backend.
npm create vite@latest my-app -- --template svelte Build for production
Run the build command to generate static output in dist/.
cd my-app && npm run build Deploy to ZeroDeploy
One command to push your frontend to the edge. It's live in seconds.
zerodeploy deploy --dir dist Configuration tips
Connecting your frontend to PocketBase.
- Store your PocketBase URL as an environment variable:
VITE_POCKETBASE_URL. Point it to your production PocketBase instance (e.g.,https://pb.yourdomain.com). - Initialize the PocketBase client:
new PocketBase(import.meta.env.VITE_POCKETBASE_URL). - Make sure your PocketBase instance has CORS configured to allow requests from your ZeroDeploy domain. PocketBase allows all origins by default, but verify if you've customized the settings.
Things to know
PocketBase-specific tips to avoid common pitfalls.
- PocketBase must be accessible from the internet for your deployed frontend to work. If it's running locally, your deployed SPA can't reach it. Host PocketBase on a VPS, Railway, or Fly.io for production.
- PocketBase allows all CORS origins by default. If you've restricted CORS in your PocketBase settings, add your ZeroDeploy URL to the allowed origins.
- For SPAs with client-side routing, create a
public/_redirectsfile with/* /index.html 200. Learn more about redirects → - PocketBase auth tokens are stored client-side by the PocketBase SDK. They persist in localStorage — no server-side session management needed.
Everything you need
Host your PocketBase 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 deploy a PocketBase frontend on ZeroDeploy?
Yes. ZeroDeploy hosts your SPA (React, Vue, Svelte, etc.) while PocketBase runs on your own server. Your frontend connects to PocketBase's API at runtime — ZeroDeploy serves the static files, PocketBase handles the data.
Where should I host my PocketBase backend?
Anywhere that can run a Go binary. Popular choices: a VPS (Hetzner, DigitalOcean), Railway, Fly.io, or your own server. PocketBase is a single file — deployment is copying the binary and running it.
Does PocketBase real-time work with ZeroDeploy?
Yes. PocketBase's real-time subscriptions use Server-Sent Events (SSE) from the browser. Your frontend loads from ZeroDeploy, then connects to PocketBase for real-time updates. The hosting layer doesn't interfere.
Do I need to configure CORS for PocketBase?
PocketBase allows all origins by default, so it works out of the box. If you've customized CORS settings, add your ZeroDeploy URL (e.g., https://myapp.zerodeploy.app) to the allowed origins in PocketBase's settings.
Also works with
ZeroDeploy hosts frontends for any backend-as-a-service.
Framework deploy guides
Host your PocketBase frontend on ZeroDeploy
PocketBase on your server. Frontend on ZeroDeploy. A simple, self-hosted full-stack setup.