This guide walks you through deploying OutRay from source. By the end you will have the web dashboard, tunnel server, and cron service running and the CLI pointed at your instance.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/outray-tunnel/outray/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Node.js 20+ and npm
- PostgreSQL 14+ instance
- Redis 6+ instance
- TimescaleDB (Tiger Data) instance — must be a separate database from PostgreSQL
- A domain name (e.g.,
tunnel.example.com) with DNS pointing to your server
Install dependencies
Install dependencies for all apps from the repository root:Then install production dependencies in each app you plan to run:
Configure environment variables
Copy the example environment files and fill in your values:Web dashboard (
Tunnel server (
Cron jobs (
Internal check service (
Web dashboard (apps/web/.env)
Tunnel server (apps/tunnel/.env)
Cron jobs (apps/cron/.env)
Internal check service (apps/internal-check/.env)
INTERNAL_API_SECRET must be the same value in both apps/web/.env and passed to the tunnel server. It authenticates requests between the two services.Run database migrations
Apply the Drizzle schema to your PostgreSQL database:Then initialize the TimescaleDB hypertables and continuous aggregates. Run the setup script against your TimescaleDB instance:This script is idempotent — it is safe to run multiple times. It creates the
tunnel_events, protocol_events, active_tunnel_snapshots, and request_captures hypertables, along with indexes, continuous aggregates, and a scheduled cleanup job.Start the services
Start each service with your process manager. The example below uses PM2:For the web dashboard, deploy To verify the tunnel server is running:You should see
apps/web as a standard Vite/React build. You can serve it from any static hosting provider or behind a reverse proxy like Caddy or nginx.The internal check service must be reachable at
http://localhost:3001/internal/domain-check by your reverse proxy. This endpoint is used by Caddy on-demand TLS to verify that a custom domain belongs to an OutRay user before issuing a certificate.outray-tunnel with status online.Configure the CLI to use your server
Users of your self-hosted instance need to point the OutRay CLI at your server URL instead of the default hosted service.Option 1 — Environment variable:Option 2 — Option 3 — The
server_url in outray/config.toml:--dev flag (for local development):--dev flag points the CLI at ws://localhost:3547, useful when running all OutRay services locally.Verifying the deployment
After starting all services, run through this checklist:- Open your web dashboard URL in a browser and confirm the login page loads.
- On the server, run
pm2 listand confirmoutray-tunnel,outray-internal-check, andoutray-cronall showonline. - From a local machine, set
OUTRAY_SERVER_URLto your tunnel server URL and runoutray http 3000. Confirm you receive a public tunnel URL. - Make a request to the tunnel URL and verify it appears in the dashboard’s analytics view.