Tutorial 7 of 7
Self-host Pixel Kit
Run Pixel Kit on your own server: what you need, the variables and the commands.
Steps
- 1
Get what you need
Node.js 24, pnpm 11, a MongoDB replica set (Atlas free tier works) and a Cloudinary account for image uploads.
- 2
Set the variables
Put MONGO_URI, JWT_SECRET, your Cloudinary keys and NEXT_PUBLIC_SITE_URL in .env.local, or in your host's environment.
- 3
Turn on sign-in
Create a Google or GitHub OAuth app with the callback /api/auth/google/callback or /api/auth/github/callback and set its client id and secret.
- 4
Build and run
Run pnpm install, pnpm build and pnpm start, then run scripts/create-indexes.ts once against the database. The app, the API and the MCP server run in the same process on port 3000.
- 5
Read the full guide
SELF_HOSTING.md has every variable, the database setup and deploys on Vercel, a VPS or Docker.