Skip to content

Local Tunneling โ€‹

Share your local development site with anyone, anywhere.

Local tunneling creates a secure bridge between your computer and the internet. Instead of deploying to a staging server, you can instantly share your localhost site with clients, teammates, or testers.

Why use tunnels? โ€‹

  • ๐Ÿš€ Quick demos โ€” Show clients your work without deploying
  • ๐Ÿงช Test webhooks โ€” Receive payments, emails, or API callbacks on localhost
  • ๐Ÿ‘ฅ Remote testing โ€” Let teammates view your site from their devices
  • ๐Ÿ”’ Secure access โ€” Encrypted connections with optional password protection

Alternatives to ngrok, localtunnel, and similar tunnel services.

Set Up Tunnel Services โ€‹

Tunnel services expose your local development sites to the internet via SSH, allowing you to share work with clients, test webhooks, or test on mobile devices. AMP Manager uses simple SSH-based tunnel services that don't require downloading extra software or complex authentication.

How It Works โ€‹

AMP Manager integrates with SSH-based tunnel services. Your local sites run on Angie server (port 8080) with virtual host configuration. The tunnel service forwards requests from a public URL to your local server.

Quick Summary:

  1. Click Start Tunnel in AMP Manager
  2. Tunnel service creates a public URL (e.g., myproject.localto.net)
  3. Anyone on the internet can visit that URL
  4. Requests route back through SSH tunnel to Angie
  5. Angie serves the correct domain based on the Host header

This lets you share your local development with students, mentors, or colleagues instantly - no deployment needed.

Supported Services โ€‹

ServiceSubdomain FormatAuthSetup Required
localhost.run{random}.localhost.runNoneNone
Serveo{name}.serveousercontent.comNoneNone
Localtonet{name}.localto.netTokenFree account

Placeholders โ€‹

When configuring tunnel commands, use these placeholders:

PlaceholderDescriptionExample
{domain}Full local domainmyproject.local
{port}Local server port8080

localhost.run โ€‹

The simplest option - no setup required. The service assigns a random subdomain automatically.

bash
ssh -R 80:{domain}:8080 nokey@localhost.run
# Example: ssh -R 80:myproject.local:8080 nokey@localhost.run
# -> https://{random}.localhost.run
  • Setup: None - works out of the box
  • Pros: Zero configuration, automatic HTTPS, completely free
  • Cons: Random subdomain (changes each session), no custom names
  • Best for: Quick testing, sharing with clients temporarily

WordPress โ€‹

WordPress stores absolute URLs in the database. When using a tunnel, the public URL differs from your local *.local domain.

Required Configuration:

Add to your wp-config.php:

php
// Use the tunnel URL dynamically
$scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
define('WP_HOME', $scheme . '://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', $scheme . '://' . $_SERVER['HTTP_HOST']);

Alternative (plugin):

Important: Free subdomains change on reconnect. For persistent WordPress development, consider:

  1. Custom Domain plan from localhost.run
  2. Use Localtonet for stable URLs (free account, custom subdomain)

Laravel โ€‹

Laravel generally works well with tunnels out of the box. One consideration:

APP_URL Configuration:

For proper URL generation in emails, notifications, and asset URLs:

bash
# In your .env file - tunnel will override this
APP_URL=https://your-tunnel-url.localhost.run

For dynamic detection:

php
// In config/app.php
'url' => env('APP_URL', 'http://localhost'),

Most Laravel apps work seamlessly - the tunnel handles the routing correctly.

Serveo โ€‹

Similar to localhost.run but allows custom subdomain names.

bash
ssh -R {name}:80:{domain}:8080 serveo.net
# Example: ssh -R myproject:80:myproject.local:8080 serveo.net
# -> https://myproject.serveousercontent.com
  • Setup: None - works out of the box
  • Pros: Custom subdomain possible, no setup required, free
  • Cons: Subdomain may be taken if you want a popular name
  • Best for: Named tunnels without any account

Localtonet โ€‹

Requires a free account and token from localtonet.com. The service provides a user-friendly dashboard and supports persistent URLs.

bash
ssh -p 223 -R {name}:80:{domain}:8080 YOUR_TOKEN@localto.net
# Example: ssh -p 223 -R myproject:80:myproject.local:8080 mytoken@localto.net
# -> https://myproject.localto.net
  • Setup: Create free account at localtonet.com, generate token in dashboard
  • Pros: Custom subdomain, persistent URLs, free dashboard to manage tunnels
  • Cons: Requires token, different SSH port (223)
  • Best for: Persistent tunnels with your own subdomain

Getting your token:

  1. Visit localtonet.com/register to create an account
  2. Log in to the Dashboard
  3. Go to Tunnels -> New Tunnel -> Select HTTP
  4. Click Settings -> SSH Command to get your one-liner
  5. Copy the token portion (before @) and add to Credentials in AMP Manager

Reference: See Localtonet Zero-Install SSH Docs for more details.

WordPress โ€‹

Same configuration as localhost.run - add to wp-config.php:

php
$scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
define('WP_HOME', $scheme . '://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', $scheme . '://' . $_SERVER['HTTP_HOST']);

Advantage over localhost.run: Localtonet persistent URLs don't change, so WordPress URL updates are one-time only.

Laravel โ€‹

Works out of the box. Set your .env:

bash
APP_URL=https://myproject.localto.net

Setup Steps โ€‹

  1. Go to Settings -> Tunnel Services
  2. Enable your preferred tunnel provider
  3. For Localtonet: Add your token to Credentials
  4. Open domain details and click Start Tunnel
  5. Copy the public URL to share

Use Cases โ€‹

  • Share local site with client
  • Test webhooks from external services (Stripe, GitHub, etc.)
  • Mobile testing on real URL
  • Demo prototypes without deployment

Other Tunnel Services โ€‹

AMP Manager includes the most popular SSH-based tunnel services. If you need to use other services like Cloudflare Tunnel, ngrok, or localtunnel, you can still connect them to your local development environment.

Key Information:

  • Angie server listens on port 8080
  • Use {domain}:8080 as your local target (e.g., myproject.local:8080)
  • This tells the tunnel service which virtual host to serve

Example:

bash
# Cloudflare Tunnel
cloudflare tunnel --url localhost:8080
# Or with specific domain:
cloudflare tunnel --url myproject.local:8080

# ngrok
ngrok http myproject.local:8080

Requirements for other services:

  • Download their CLI binary (place in PATH or /bin)
  • Configure API authentication (token, account)
  • Different setup than SSH-based services

See Also โ€‹

AMP Manager
Released under the MIT License.