💽 Self-hosting Convex
Template
Uses SQLite but good enough for side projects -> https://railway.com/deploy/OKpPqB
Commands
Stuff like bunx convex deploy assumes you're using their cloud product and npx convex login doesn't work for self-hosted either.
The workaround is to pass an env file to the command:
bunx convex deploy --env-file .env.productionAlternatively, you can inline CONVEX_SELF_HOSTED_URL and CONVEX_SELF_HOSTED_ADMIN_KEY.
Local dev
Run Convex with bunx convex dev.
To run scripts, pass the local Convex URL. Example:
CONVEX_URL=http://127.0.0.1:3210 bun run syncNotes
Use
bunx convex deployafter any mutation or function to make sure it's deployed to production.