Skip to content

Getting Started

Get up and running with Porthole in minutes. This guide covers installation and your first tunnel.

Run instantly with npx (no install):

Terminal window
npx @porthole.dev/cli 8080

Or install the CLI globally with npm:

Terminal window
npm install -g @porthole.dev/cli

Once installed, you can expose a local port with a single command:

Terminal window
porthole 8080

This will generate a public URL that forwards traffic to your local service running on port 8080.

By default, Porthole uses your git repository or folder name as the subdomain. If that name is already in use, it automatically retries with a short random suffix.

To request a specific subdomain:

Terminal window
porthole 8080 --name demo-api

If demo-api is taken, the CLI will fall back to demo-api-<random> automatically.

  • porthole <port>: Expose a local HTTP/HTTPS service.
  • porthole list: List active tunnels (preview).
  • porthole stop <tunnel-id>: Stop a running tunnel (preview).

Porthole works out of the box with sensible defaults, but you can customize your experience using environment variables.

  • PORTHOLE_RELAY_HOST: Override the relay WebSocket host (e.g. localhost:8787).
  • PORTHOLE_TUNNEL_DOMAIN: Override the public tunnel domain.