ROUT

    Open source

    Self-hosting guide

    ROUT is fully open source. Follow these steps to run your own instance — your domain, your database, your data.

    Prerequisites
    Node.js >= 18 or Bun v1.0+Postgres database (Neon or self-hosted)Custom domain with DNS access
    1. 1. Clone the repository

      ROUT is licensed under AGPLv3. Grab the source and install dependencies with Bun (or npm).

      bash
      git clone https://github.com/routbe/rout
      cd rout-qr
      bun install
    2. 2. 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. 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. 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.

      bash
      psql "$DATABASE_URL" -f db/00_compat.sql
    5. 5. Start the development server

      The app runs on http://localhost:8080 with hot reload.

      bash
      bun run dev
    6. 6. 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.

      bash
      bun run build
    7. 7. 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.