Publish to the Web
Production build, Firebase Hosting, Vercel, a custom domain, and PWA.
Implementation
Via MCP: for web Auth with a custom domain, ask "list authorized domains" or "add app.yourbrand.com to the domains" (manage_domain). Favicon: set_favicon. Static build/hosting is still via the terminal (below). See Kasy MCP.
-
Generate the production build:
flutter build web --release --dart-define=ENV=prodThe finished site lands in the
build/webfolder. It's a static site: any hosting works.--dart-define=ENV=prodis required. Without it the build uses the development config. -
Choose your hosting:
Option 1: Firebase Hosting (Firebase backend)
If your backend is Firebase, the project already comes configured:
firebase.jsonpoints atbuild/web, with the right SPA rewrites and cache headers. Publishing is just:flutter build web --release --dart-define=ENV=prod firebase deploy --only hostingAt the end, the terminal shows the URL (
https://your-project.web.app).For a custom domain:
- Firebase Console → Hosting → Add custom domain
- Type in the domain (e.g.,
app.yourbrand.com) - Create the DNS records the console shows you (at your domain provider)
- Wait for verification: the HTTPS certificate is automatic
Option 2: Vercel (any backend)
Works with Firebase, Supabase, or REST API, since the build is static.
- Create an account at vercel.com
- Run the production build (command above)
- Publish the folder:
npm i -g vercel cd build/web vercel --prodCustom domain: Vercel dashboard → your project → Settings → Domains.
Netlify, Cloudflare Pages, or any static host also work: the process is the same, build and upload the
build/webfolder. -
After publishing, unlock login:
Google Sign-In
Add the production domain and
http://localhost:5555as authorized origins: Google Cloud Console → Credentials → your OAuth Client → Authorized JavaScript origins.Firebase Auth (authorized domains)
Firebase Console → Authentication → Settings → Authorized domains → add the production domain. Without this, social login fails with
auth/unauthorized-domain.Supabase Auth (authorized domains)
Supabase Dashboard → Authentication → URL Configuration → add the production domain (and
http://localhost:5555while testing locally) under Site URL / Redirect URLs. Without this, social login redirects to the wrong domain or fails silently. Automated deploy only setslocalhost:5555inuri_allow_list.
Information
Development
kasy run --web # prints localhost:5555
kasy run --web --open-browser # opens in your browser (Google account, extensions)
kasy run --web --open-browser --fresh # same browser, clears dev storage (onboarding)
kasy clear-web # clear storage only (app already running)
kasy run --web --open # Flutter's isolated Chrome (clean profile, no account)| Command | Where it opens |
|---|---|
--open-browser | System default browser, in the profile where you're already logged in |
--open | A separate Flutter Chrome window, no accounts or extensions |
Port 5555 is fixed so the Firebase Auth session persists between runs. Details in Run the app.
PWA
The web app is already installable as a PWA. Customize:
- Icons and colors:
web/manifest.json(background_color,theme_color) - Favicon:
kasy favicon --image your-icon.png(guide)
Last updated on 08/02/2026

