Skip to content

Starting a Tunnel

The primary command for Porthole is starting a new tunnel to expose your local development server.

To start a tunnel for a service running on port 3000:

Terminal window
porthole 3000

This will generate a public URL that forwards traffic to localhost:3000.

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

Terminal window
porthole 3000 --name design-preview

If design-preview is already in use, the CLI falls back to design-preview-<random> automatically.

When a tunnel is running, Porthole provides a real-time dashboard in your terminal showing:

  • Public URL: The external address of your tunnel.
  • Connection Status: Real-time status of the relay connection.
  • Request Log: A live stream of incoming HTTP requests.
  • Stats: Total requests, uptime, and latency.

You can quickly share or open your tunnel on a mobile device using a QR code.

  • Start with QR: Use the --qr flag to open the QR code modal immediately on start.
  • Toggle QR: Press q or c while the tunnel is running to show or hide the QR code modal.
  • Close QR: Press Esc or q to close the modal.

To stop the tunnel and disconnect from the relay, press Ctrl+C in the terminal where the CLI is running.