Personal ngrok alternative. Expose local ports to the internet with automatic HTTPS, an interactive TUI dashboard, and HTTP request inspection -- all through your own VPS.
ssh-keygen to generate one if you don't have one)Add a wildcard A record with your DNS provider (Cloudflare, Vercel, Namecheap, etc):
| Type | Name | Value |
|---|---|---|
| A | * | <your-vps-ip> |
curl -fsSL https://raw.githubusercontent.com/R44VC0RP/pgrok/main/install.sh | bash -s client
(if you have a windows machine, and you get this running, please open a PR!)
You'll be prompted for your VPS IP, domain, and email. The installer will:
- Auto-detects your SSH key
- Builds and installs the pgrok command
- Copies a server setup command to your clipboard (with your SSH key embedded)
SSH into your VPS and paste the command from step 2. Or run:
curl -fsSL https://raw.githubusercontent.com/R44VC0RP/pgrok/main/install.sh | sudo bash -s server
The script installs Caddy, configures SSH tunneling, adds your SSH key, and starts everything.
pgrok myapp 4000
# => https://myapp.yourdomain.com -> localhost:4000
# Expose a local dev server
pgrok myapp 4000
# -> https://myapp.yourdomain.com
# Expose an API
pgrok api 3000
# -> https://api.yourdomain.com
# Any subdomain works instantly
pgrok staging 8080
# -> https://staging.yourdomain.com
# Debug mode -- dumps raw tunnel logs on exit
pgrok myapp 4000 --print-logs
Press Ctrl+C to stop. The route is cleaned up automatically.
Rebuild the binary after pulling updates:
./setup.sh client --rebuild
The dashboard shows in real-time:
Request log colors: - Methods: GET (blue), POST (purple), PUT/PATCH (yellow), DELETE (red) - Status: 2xx (green), 3xx (cyan), 4xx (yellow), 5xx (red) - Duration: <100ms (green), 100-500ms (yellow), >500ms (red)
myapp.yourdomain.compgrok-ask: "Should I get a cert for this domain?"pgrok-ask verifies it's a single-level subdomain of *.yourdomain.compgrok user with restricted SSH (remote forwarding only)GatewayPorts no)pgrok-ask prevents cert abuse -- only allows single-level subdomains~/.pgrok/config)Generated by the installer. Edit manually if needed:
PGROK_HOST=your-vps-ip
PGROK_DOMAIN=yourdomain.com
PGROK_USER=pgrok
PGROK_SSH_KEY=~/.ssh/id_ed25519
/opt/pgrok/)| File | Purpose |
|---|---|
Caddyfile |
On-demand TLS config with LE + ZeroSSL |
docker-compose.yml |
Caddy container |
Script (/usr/local/bin/) |
Purpose |
|---|---|
pgrok-tunnel |
Manages Caddy routes + provisions TLS certs |
pgrok-ask |
Validates cert requests (systemd service) |
Stuck on "connecting" in the TUI:
- Run with --print-logs, press Ctrl+C, check /tmp/pgrok-debug.log
- Verify SSH works: ssh pgrok@your-vps-ip echo ok
Stuck on "provisioning TLS...":
- Let's Encrypt may be rate-limited (50 certs/week). ZeroSSL fallback handles this.
- Check Caddy logs: docker compose logs caddy in /opt/pgrok
SSL certificate errors:
- Verify pgrok-ask is running: systemctl status pgrok-ask
- Make sure ports 80 and 443 are open
- Cloudflare proxy (orange cloud) must be OFF for the wildcard record
cd client/tui
bun install
bun run index.ts myapp 4000 # dev mode
bun run build # compile binary
bun run tsc --noEmit # type-check
pgrok if connection drops)We welcome contributions! Please open an issue or PR.
MIT
$ claude mcp add pgrok \
-- python -m otcore.mcp_server <graph>