Open source
Self-hosting guide
ROUT is fully open source. Follow these steps to run your own instance — your domain, your database, your data.
1. Clone the repository
ROUT is licensed under AGPLv3. Grab the source and install dependencies with Bun (or npm).
bashgit clone https://github.com/routbe/rout cd rout-qr bun install2. Create a database project
ROUT stores tracked QR codes and scan events in Postgres. Create a Postgres-compatible project and note its connection string (DATABASE_URL).
3. Configure environment variables
Create a .env file with the public client keys, then add the server-side secrets in your hosting provider (never commit them).
env# server-only DATABASE_URL=postgres://<user>:<password>@<host>/<database>?sslmode=require PUBLIC_SITE_URL=https://<your-domain> BREVO_API_KEY=<brevo-api-key>4. Run the database migrations
Apply the SQL files in db/ to create the tracked_qrs and qr_scans tables, their row-level-security policies and grants. Uploaded images, PDFs and audio are stored in Postgres itself — no external object storage is required.
bashpsql "$DATABASE_URL" -f db/00_compat.sql5. Start the development server
The app runs on http://localhost:8080 with hot reload.
bashbun run dev6. Deploy
Build the production bundle and deploy to any edge-compatible host (Cloudflare Workers, Vercel, Netlify). Set the same server-side environment variables in your host and point your custom domain at it — short links use your own domain, so scans never touch third-party infrastructure.
bashbun run build7. Keep your fork compliant
AGPLv3 requires that you publish the source of any modified version you make available over a network. Keep the ROUT attribution and license notice intact, and link back to your own source repository.