{"name":"pgrok: A Multi-Tenant HTTP/TCP Reverse Tunnel Solution via SSH","description":"pgrok is a \"poor man's ngrok\" designed for small teams, offering a multi-tenant HTTP/TCP reverse tunnel solution through SSH remote port forwarding. It provides stable subdomains for every user, gated by your SSO through the OIDC protocol, making it a cost-effective alternative for exposing local development environments to the public internet.","github":"https://github.com/pgrok/pgrok","url":"https://osrepos.com/repo/pgrok-pgrok","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/pgrok-pgrok","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/pgrok-pgrok.md","json":"https://osrepos.com/repo/pgrok-pgrok.json","topics":["go","pgrok","reverse-tunnel","ssh-tunnel","ngrok-alternative","sso","http","tcp"],"keywords":["go","pgrok","reverse-tunnel","ssh-tunnel","ngrok-alternative","sso","http","tcp"],"stars":null,"summary":"pgrok is a \"poor man's ngrok\" designed for small teams, offering a multi-tenant HTTP/TCP reverse tunnel solution through SSH remote port forwarding. It provides stable subdomains for every user, gated by your SSO through the OIDC protocol, making it a cost-effective alternative for exposing local development environments to the public internet.","content":"## Introduction\n\npgrok is an open-source, multi-tenant HTTP/TCP reverse tunnel solution that leverages SSH remote port forwarding. Billed as a \"poor man's ngrok,\" it's specifically designed for small teams that need to expose their local development environments to the public internet. It stands out by offering stable subdomains for individual users, secured by your own Single Sign-On (SSO) provider via the OIDC protocol.\n\nThis project aims to provide a simpler, more controlled alternative to commercial services for internal team use, allowing developers, community managers, sales, and PMs to easily share their local work without deep server operations knowledge. It requires you to bring your own domain name and SSO provider, offering a tailored and cost-efficient solution.\n\n## Installation\n\nSetting up pgrok involves configuring both a server component (`pgrokd`) and a client (`pgrok`).\n\n**Prerequisites:**\n\n*   A domain name (e.g., `example.com`)\n*   A server (VPS, dedicated) with a public IP address\n*   An SSO provider that supports OIDC (e.g., Google, Okta, GitLab)\n*   A PostgreSQL server\n\n**Server Setup (`pgrokd`):**\n\n1.  **DNS Records:** Add `A` records for your domain and a wildcard subdomain (e.g., `example.com` and `*.example.com`) pointing to your server's public IP.\n2.  **Server Deployment:** Set up `pgrokd` using a [single binary](https://github.com/pgrok/pgrok/blob/main/docs/admin/single-binary.md \"pgrokd Single Binary Setup\" target=\"_blank\"), [Docker](https://github.com/pgrok/pgrok/blob/main/docs/admin/docker.md#standalone-docker-container \"pgrokd Docker Setup\" target=\"_blank\"), or [Docker Compose](https://github.com/pgrok/pgrok/blob/main/docs/admin/docker.md#docker-compose \"pgrokd Docker Compose Setup\" target=\"_blank\").\n3.  **Network Security:** Allow inbound requests to port `2222` (and `10000-15000` for TCP tunnels) on your server.\n4.  **Reverse Proxy:** Install and configure Caddy 2 to proxy requests to `pgrokd`.\n5.  **OIDC Client:** Create an OIDC client in your SSO provider with the Redirect URI set to `http://example.com/-/oidc/callback`.\n\n**Client Setup (`pgrok`):**\n\n1.  **Obtain Token:** Visit your `pgrokd` instance (e.g., `http://example.com`), authenticate with SSO, and obtain your unique token and URL.\n2.  **Download Client:**\n    *   For Homebrew: `brew install pgrok`\n    *   For others, download from the [Releases page](https://github.com/pgrok/pgrok/releases \"pgrok Releases\" target=\"_blank\").\n3.  **Initialize Config:** Run `pgrok init --remote-addr example.com:2222 --forward-addr http://localhost:3000 --token {YOUR_TOKEN}`.\n4.  **Launch Client:** Execute `pgrok` or `pgrok http` to start the tunnel.\n\nFor detailed instructions and HTTPS setup, refer to the official [pgrok documentation](https://github.com/pgrok/pgrok/tree/main/docs/admin \"pgrok Admin Documentation\" target=\"_blank\").\n\n## Examples\n\n**HTTP Tunneling:**\n\nTo forward requests to `http://localhost:8080`:\n\nsh\npgrok http 8080\n\n\n**Raw TCP Tunnels:**\n\nTo tunnel raw TCP traffic, for example, for a PostgreSQL database on port `5432`:\n\nsh\npgrok tcp 5432\n\n\n**HTTP Dynamic Forwards:**\n\nConfigure `dynamic_forwards` in your `pgrok.yml` to route specific paths to different local addresses:\n\nyaml\ndynamic_forwards: |\n  /api http://localhost:8080\n  /hook http://localhost:8080\n\n\nThis will forward requests to `/api` and `/hook` to `http://localhost:8080`, while other requests go to your `forward_addr`.\n\n**Vanilla SSH Client:**\n\nSince pgrok uses the standard SSH protocol, you can also use a vanilla SSH client:\n\n1.  Obtain your token and URL from the `pgrokd` web interface.\n2.  Run `ssh -N -R 0::3000 example.com -p 2222` and enter your token as the password.\n\n## Why Use pgrok?\n\npgrok addresses the common pain points of high costs associated with stable subdomains and SSO integration in other tunneling solutions. It's built for teams who value simplicity and efficiency, especially when exposing local services for testing, demos, or collaboration.\n\n*   **Cost-Effective:** Avoids the high enterprise tier costs of commercial alternatives by allowing you to use your existing infrastructure and SSO provider.\n*   **Simplified UX:** Offers a \"Copy, paste, and run\" experience, making it accessible even for team members without extensive server operations knowledge.\n*   **Stable Subdomains & SSO:** Provides consistent URLs for users, secured by your organization's SSO, which is crucial for internal team workflows.\n*   **Flexibility:** Supports both HTTP and raw TCP tunneling, with advanced features like dynamic HTTP forwards.\n\n## Links\n\n*   **GitHub Repository:** [https://github.com/pgrok/pgrok](https://github.com/pgrok/pgrok \"pgrok GitHub Repository\" target=\"_blank\")\n*   **Releases:** [https://github.com/pgrok/pgrok/releases](https://github.com/pgrok/pgrok/releases \"pgrok Releases\" target=\"_blank\")\n*   **Contributing Guide:** [https://github.com/pgrok/pgrok/blob/main/.github/contributing.md](https://github.com/pgrok/pgrok/blob/main/.github/contributing.md \"pgrok Contributing Guide\" target=\"_blank\")","metrics":{"detailViews":2,"githubClicks":3},"dates":{"published":null,"modified":"2026-02-16T12:01:06.000Z"}}