Self-Hosting
Run Mock Alpha locally or deploy it to your own server
Self-Hosting
Mock Alpha is a standard Next.js application backed by PostgreSQL. You can run it locally for solo development, or deploy it to a server so your whole team shares one instance (recommended).
Run locally
Prerequisites
- Node.js 20+
- Docker (for PostgreSQL)
1. Clone and install
git clone https://github.com/your-org/mock-alpha.git
cd mock-alpha
npm install2. Start the database
docker compose up -d postgresThis starts a PostgreSQL instance on localhost:5432.
3. Configure environment
Create .env.local:
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/mockalpha
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=change-me-in-production4. Run database migrations
npm run db:migrate5. Start the dashboard
npm run devOpen http://localhost:3000 and continue with the Quick Start — using http://localhost:3000 as your instance URL.
Reaching a local instance from a device: Android emulators use
http://10.0.2.2:3000, iOS simulators usehttp://localhost:3000, and physical devices need your machine's LAN IP (http://192.168.x.x:3000) oradb reverse tcp:3000 tcp:3000on Android. See the base URL table in Client Integration. A deployed instance avoids all of this.
Deploy to a server
Deploying Mock Alpha gives your team a single shared URL — no per-developer setup, no emulator IP juggling, and collaborators can manage the same projects together.
The dashboard runs as a standard Next.js application and can be deployed to any Node.js host (a VPS with Docker, Railway, Fly.io, etc.). Checklist:
- Set
NEXTAUTH_URLto your public URL (e.g.,https://mock-alpha.your-domain.com) - Use a strong random
NEXTAUTH_SECRET—openssl rand -base64 32 - Point
DATABASE_URLat a managed PostgreSQL service (Supabase, Neon, Railway) or a co-located container - Put the app behind HTTPS (reverse proxy such as Caddy or nginx)
- If clients connect to MQTT directly, expose ports 1883 (TCP) and 1884 (WebSocket) — or set
MQTT_ENABLED=falseto disable the broker
Vercel / serverless note: the embedded MQTT broker needs a long-lived Node.js process. On serverless platforms, HTTP mocking works but MQTT does not — use a VPS or container host if you need MQTT.
For a step-by-step Ubuntu VPS deployment using the prebuilt Docker images (GitHub Actions + GHCR), see VPS_RUNBOOK.md in the repository root.
Configuration reference
All environment variables are documented in Configuration.