# How to host a game built with Cursor

> A practical guide to deploying a browser game made in Cursor—from checking production bundles and asset paths to automating deploys with static hosts or a Pita workspace.

Published: 2026-11-30 · Updated: 2026-12-01 · Canonical: https://pita.sh/blog/how-to-host-a-game-made-with-cursor

To host a game built with **Cursor**, first verify that `npm run build && npm run preview` works cleanly without missing assets, then deploy the built `dist/` folder to either a static web host (for lightweight single-player games) or a game workspace like Pita (if you have heavy assets, playtest environments, or multiplayer servers).

## 1. Check the three things Cursor prototypes commonly miss before deploy

Cursor's Composer/Agent mode is fast at getting a Vite + Three.js or Phaser prototype running on `localhost`, which can mask production issues:
- **Unbundled assets outside `public/`:** If Cursor writes `fetch('/maps/level1.json')` or `loader.load('/models/tank.glb')`, confirm those files actually live in `public/maps/` and `public/models/` so Vite copies them into `dist/`.
- **TypeScript build checks skipped during dev:** Vite dev mode doesn't run `tsc`. Have Cursor run `npx tsc --noEmit && npm run build` so build-time type errors don't fail on deploy.
- **Large textures or `.wav` audio committed to Git:** If your `public/` folder grows past ~30–50 MB, convert textures to `.webp`, music to `.ogg`, and keep raw binaries out of Git history (see [How to manage large game assets without Git LFS](/blog/why-git-lfs-breaks-game-repos)).

## 2. Hosting options for a Cursor game

### Static hosts (Cloudflare Pages, Vercel, Netlify, GitHub Pages)
Best when your entire game bundle is under ~20 MB and has no persistent game server:
- Connect your GitHub repo so every push to `main` redeploys, or let Cursor's terminal agent run `npx wrangler pages deploy dist` (Cloudflare Pages).
- If deploying to GitHub Pages, set `base: './'` in `vite.config.ts` so asset URLs resolve under `/<repo-name>/`.

### itch.io (public or password-gated HTML5 builds)
Best if you want a public indie storefront page:
- Install `butler` and add a `"deploy"` script (`npm run build && butler push dist yourname/game:html5`) so Cursor can push updated builds without manual zip uploads.

### Pita (agent-operated deploys, heavy assets, invite links, optional servers)
If you want Cursor itself to manage git, binary assets, staging environments, and rollbacks without switching to web dashboards:
- Start free on [Pita](/) ($0 forever for 1 static game with 2 GiB storage, or Basic at $14/mo with a 7-day free trial for 5 games, 10 environments per game, collaborators, and multiplayer servers with SQLite), and connect Cursor via Pita's account MCP server (`https://api.pita.sh/mcp`) or a per-game agent link.
- Cursor installs `pita`, syncs `assets.lock`, runs `pita publish --to production` (FastCDC delta uploads), and returns a private playtest link.

## 3. Add a `.cursor/rules` or `AGENTS.md` note for clean deploys

Once you pick a host, document the build and deploy commands in your repo's `AGENTS.md` (or `.cursor/rules`) so Cursor never invents a different upload command or breaks your `vite.config.ts` on future sessions.

## FAQ

### Can I move a Cursor game to Steam or iOS later?
Yes—unlike closed browser AI game builders, a Cursor project is already a standard local codebase. Once the game feels solid in browser playtests, you can package `dist/` with Electron/Tauri for Steam or Capacitor for iOS (see [How to ship an AI-generated game to Steam and iOS](/blog/how-to-ship-an-ai-generated-game-to-ios-and-steam)).

### What if Cursor built both a Vite frontend and a multiplayer server?
Static hosts won't run a persistent WebSocket game server. You can deploy an arbitrary Node/Go container on a host like Fly.io or Railway, or run your client alongside a sandboxed JavaScript (`@pita/sdk/server`) or WebAssembly (`.wasm`) server with built-in SQLite in one workspace using `pita.toml` on Pita.
