System Requirements
Node.js 20+
rs-tunnel requires Node.js version 20 or higher for modern JavaScript features and optimal performance.
pnpm 10
Package manager for monorepo workspace management. Version 10.0.0 or higher is required.
Docker
Required for running PostgreSQL database locally or in production.
PostgreSQL 16+
Database for storing users, tunnels, leases, and metrics. Recommended via Docker using postgres:16-alpine.
Install Node.js 20+
Install Docker
Install Docker Desktop or Docker Engine:
- macOS/Windows: Docker Desktop
- Linux: Docker Engine
Slack App Configuration
rs-tunnel uses Slack OpenID Connect for authentication. You must create and configure a Slack app.Create a Slack App
- Go to api.slack.com/apps
- Click Create New App
- Choose From scratch
- Enter app name (e.g., “rs-tunnel”)
- Select your workspace
Enable Sign in with Slack
- Navigate to OAuth & Permissions
- Under Redirect URLs, add:
For production, use your actual API base URL:
- Scroll to Scopes and add:
openidprofileemail
To find your Slack Team ID:
- Open Slack in a browser
- The URL will be
https://app.slack.com/client/T123456789/... T123456789is your team ID
Cloudflare Account Setup
rs-tunnel manages Cloudflare Tunnels and DNS records programmatically.Cloudflare Account
Create a Cloudflare account at cloudflare.com if you don’t have one.
Add a Domain
- Add your domain to Cloudflare
- Update your domain’s nameservers to Cloudflare’s nameservers
- Wait for DNS propagation (usually 5-30 minutes)
Get Account and Zone IDs
- Go to your domain overview in Cloudflare dashboard
- Scroll down to API section on the right sidebar
- Copy Zone ID → This is your
CLOUDFLARE_ZONE_ID - Copy Account ID → This is your
CLOUDFLARE_ACCOUNT_ID
Create API Token
You need a token with specific permissions:
- Go to My Profile → API Tokens
- Click Create Token
- Use Custom token template
- Add these permissions:
- Zone → DNS → Edit
- Account → Cloudflare Tunnel → Edit
- Set Zone Resources:
- Include → Specific zone → Select your domain
- Set Account Resources:
- Include → Your account
- Click Continue to summary → Create Token
- Copy the token → This is your
CLOUDFLARE_API_TOKEN
Security Requirements
All provider secrets (Cloudflare API token, Slack secrets, JWT secrets) must only exist in the API runtime environment. The CLI never holds these credentials.
Generate JWT Secrets
You need strong random secrets for JWT signing:Access Policy Requirements
rs-tunnel enforces strict access controls:- Email Domain Restriction: Only emails ending in
ALLOWED_EMAIL_DOMAINcan authenticate - Slack Workspace Restriction: Only users from
ALLOWED_SLACK_TEAM_IDworkspace can authenticate - Max Active Tunnels: Each user is limited to
MAX_ACTIVE_TUNNELS(default: 5) concurrent tunnels
Network Requirements
- Port 8080: API server (configurable via
PORT) - Port 5432: PostgreSQL (if running locally)
- Outbound HTTPS: API needs access to:
slack.comfor OAuthapi.cloudflare.comfor tunnel/DNS management
- Inbound HTTPS: Your API base URL must be accessible by CLI clients
Next Steps
Environment Variables
Configure all required environment variables
Docker Setup
Set up PostgreSQL and API containers

