32 min read

Keep a Tunnel URL Stable Across Container Restarts

Separate the Localtonet client from ephemeral dev containers, preserve your preview URL, and troubleshoot ports, proxy headers, WebSockets, and HMR.

Development Β· Stable Tunnel URL Β· Localtonet Β· 2026

Keep the public endpoint independent from your disposable application container

Restarting or rebuilding a development container should not force you to replace its public preview configuration. The reliable pattern is to run the Localtonet client outside the disposable application container, publish the application through a fixed host port, and continue using the existing HTTP tunnel. This guide covers container networking, local verification, Localtonet configuration, controlled restart testing, WebSocket and hot module replacement diagnostics, proxy awareness, security, and routine operations. It also explains the important limit of the pattern: preserving a tunnel configuration is not the same as guaranteeing uninterrupted application availability or permanent retention of an address after a tunnel is stopped, deleted, or recreated.

πŸ”’ Use a deliberate and locally verified target 🌐 Separate tunnel identity from container identity ⚑ Diagnose HTTP, WebSocket, and HMR paths independently

Separate the tunnel lifecycle from the container lifecycle

A host-based Localtonet client preserves one tunnel configuration while a development container is replaced.
Keeping the Localtonet client on the host prevents an application-container replacement from also replacing the client process.

A repeatable development preview begins with a lifecycle decision. The Localtonet client and the application container should not share the same disposable lifecycle. Development containers are routinely restarted, rebuilt, or recreated after source, dependency, image, or configuration changes. If the tunnel client runs inside that same container, replacing the application also terminates the client and complicates device identity, credentials, tunnel state, and reconnection behavior.

For the pattern in this guide, run the Localtonet client on the host operating system or on another persistent device that can reliably reach the application. The development server listens inside its container, Docker publishes that server through a predictable host port, and the Localtonet HTTP tunnel uses the host-side address and port as its local target.

Public HTTPS address
        |
Localtonet relay
        |
Outbound Localtonet client connection
        |
Fixed host target, for example 127.0.0.1:3000
        |
Docker published-port mapping
        |
Application listening inside the container

The objective is to preserve the existing tunnel configuration while replacing only the application behind its fixed target. A container restart or recreation does not inherently require a new Localtonet tunnel. While the container is absent, however, there is no application process behind the host port. Requests can fail until the replacement becomes ready.

URL continuity is conditional, not an unconditional retention guarantee

This architecture avoids coupling the endpoint to a particular container instance. It does not establish that every generated subdomain, selected subdomain, or custom domain will be retained under every plan, client version, process type, account state, relay selection, or tunnel lifecycle transition. Keep the existing tunnel configuration and verify the address shown in the current dashboard. Do not assume that stopping, deleting, or recreating a tunnel has the same endpoint behavior as restarting an application container.

Four operations that should not be confused

Operation What changes What this guide claims
Restart the application process The process stops and starts inside the current container. The existing tunnel can continue targeting the same host address and port, but the application is unavailable during the interruption.
Restart the application container The container stops and starts without necessarily being replaced. No new tunnel should be necessary if the host-port mapping and tunnel configuration remain unchanged.
Recreate the application container Docker replaces the container instance, and its private address may change. The fixed published host port can remain the tunnel target even though the container identity changes.
Delete or replace the Localtonet tunnel The tunnel configuration itself is removed or replaced. This is outside the continuity pattern. Do not infer that a newly created tunnel will receive the old address.

Stopping a tunnel is also different from restarting the application. Localtonet tunnels are available only while the selected client is connected and the tunnel is running. Because endpoint behavior can depend on the selected process type and current product conditions, this article does not promise that an address will survive every stop-and-start sequence. If continuity matters, keep the existing configuration, avoid unnecessary lifecycle changes, and test the exact process type you plan to distribute.

πŸ”— Existing tunnel configuration Reuse the configured HTTP tunnel rather than creating a new tunnel for each application rebuild.
πŸ“¦ Disposable application container Restart or replace the development container without terminating the separately running Localtonet client.
🎯 Fixed host-side target Publish the service through a predictable host address and port instead of targeting a container-specific private address.
πŸ” Layered verification Test the application, Docker publishing, host target, Localtonet tunnel, and browser runtime as separate layers.

Why a container IP address is usually the wrong target

Containers commonly receive private addresses from Docker-managed networks. Those addresses belong to container instances and can change when containers are recreated. A host process should not depend on a current container address when Docker can expose the service through a deliberate published port.

If the Localtonet client runs on the Docker host, configure the tunnel to use the published host address and port. The replacement container can receive a new private address while the host-side target remains unchanged.

Independent states determine whether the preview works

Layer Required state Typical failure symptom
Application The server is running and listening on the intended container interface and port. Docker logs show an error, restart loop, or unexpected listening address.
Docker publishing The container port is mapped to the expected host address and port. The app works inside the container but not through the host URL.
Localtonet client The selected device is authenticated, connected, and able to reach the target. The host URL works, but the public route remains unavailable.
HTTP tunnel The existing tunnel is running and points to the correct local IP address and port. The client is connected, but requests do not reach the intended service.
Browser runtime API calls, redirects, assets, and WebSockets use appropriate public URLs and schemes. The page loads, but login, API requests, live updates, or HMR fail.

Prepare the host, container, and application

Identify and verify the service boundary before creating public access. Start with a predictable local URL, not with the public endpoint.

  • A development application that runs in a Docker or compatible development container.
  • The actual port used by the application inside the container.
  • A fixed and currently unused host port.
  • A Docker mapping from the host address and port to the application port.
  • The Localtonet client installed and running on the host, or on another persistent device that can reach the selected local target.
  • A device-specific Localtonet authentication token selected through the supported client and dashboard workflow.
  • An available relay server or region selected from the current Localtonet dashboard.
  • A local HTTP client such as curl and browser developer tools for testing.

Examples in this guide use container port 3000 and host target 127.0.0.1:3000. These values demonstrate the architecture only. Use the port shown by your application configuration or startup output.

Verify the service before exposing it

Development servers can reveal source maps, test data, debug routes, administrative tools, environment details, or unauthenticated APIs. Remove secrets, disable unnecessary diagnostics, use sanitized data, and apply application-level authentication before sharing a public address.

Choose where the Localtonet client runs

The simplest placement for this pattern is normally the Docker host. A host-based client can target a loopback-published port such as 127.0.0.1:3000. Replacing the application container then has no direct effect on the Localtonet client process.

A separate persistent management container is a different architecture. It introduces container installation support, noninteractive authentication, secret handling, service discovery, storage, and restart questions. Our verified product information does not provide a general Localtonet container image, container startup command, or environment-variable authentication recipe for this use case. Do not invent those details or copy commands from another tunnel product.

If you are evaluating a separate container companion, read our Localtonet Dev Container tunnel companion architecture guide. It explains which support and implementation details must be confirmed before that design becomes a runnable recipe.

Choose a fixed host port

Avoid automatic host-port assignment when a tunnel needs a repeatable local target. Docker can select an available host port, but the selected value can differ after recreation. An explicit mapping makes the boundary predictable.

Check that another process is not already using the selected host port. If Docker cannot bind it, the service may fail to start. Docker status output, container logs, and a direct request to the host URL provide the most useful evidence.

Publish the development server on a fixed host port

A container application port maps to a fixed loopback port used by the host-based tunnel client.
The published host port remains the intentional boundary even when Docker replaces the container behind it.

Two settings must agree. The application must listen on a container interface reachable through Docker networking, and Docker must publish that container port on the host address targeted by Localtonet.

A frequent mistake is publishing the correct port while the application listens only on 127.0.0.1 inside the container. Container loopback belongs to that container. Published traffic commonly requires the application to listen on an appropriate container interface, often 0.0.0.0. The exact framework flag, configuration key, or environment variable is version-dependent. Use the current documentation for your development server rather than assuming that another framework's setting applies.

Docker explains the underlying behavior in its port-publishing documentation. Published ports can be exposed beyond the host depending on the address used, so select the host bind address deliberately.

Docker Compose port mapping

services:
  app:
    ports:
      - "127.0.0.1:3000:3000"

Merge this ports entry into the actual application service. The first address and port belong to the host. The final port belongs to the container. The service still requires its real image or build configuration, startup command, volumes, dependencies, and project-specific environment.

Binding to 127.0.0.1 makes the published port available to processes on the Docker host without deliberately publishing it on every host interface. This is a useful default when the Localtonet client runs on the same machine. If the client runs on another device, that device cannot reach the Docker host's loopback interface. Use an appropriate reachable host address and apply the network controls required by that architecture.

Direct Docker port mapping

docker run --rm -p 127.0.0.1:3000:3000 your-image

Replace your-image and both ports as required. Port publishing does not configure the process inside the image. The image must start the intended server, and the server must listen on the selected container port and an interface reachable through the container network.

Do not target the current container address

Avoid copying a private address from container inspection output into the Localtonet tunnel. That couples the tunnel to one container instance. A rebuild can replace that instance and assign another address even though the service still publishes the same host port.

Docker service names are useful between containers attached to the same user-defined network. A Localtonet client running directly on the host does not normally use Docker's internal service-name resolution. The published host port is the intended boundary for this design.

Preserve the mapping, not the container identity

The goal is not to keep one container forever. Preserve the host-side address and port. A replacement container can take over as long as it runs the intended service and publishes it through the same host target.

Start and inspect the Compose stack

docker compose up -d
docker compose ps
docker compose logs --tail=100 app

Replace app with the actual service name. The status output should show the expected port mapping, and the logs should show successful application startup. If the project intentionally runs in the foreground, omit -d.

A running container does not necessarily contain a working application. The application may be waiting for a dependency, reporting compilation errors, or listening on a different port. Verify the host URL before configuring Localtonet.

Verify the local target before creating the tunnel

A public tunnel cannot repair a broken local route. Prove each local boundary first.

1

Confirm that the container is running

Use docker compose ps or the equivalent Docker command. Confirm that the intended service is active and that its published-port mapping matches the project configuration.

2

Read the application startup logs

Find the actual listening port and interface. Check for compilation failures, missing dependencies, occupied ports, dependency errors, and restart loops.

3

Request the exact host-side URL

From the device that runs the Localtonet client, request the same address and port that the tunnel will target. This proves that the client device can reach the published service.

4

Confirm the returned content

Verify that the response belongs to the intended application. A successful response from an unrelated process using the same port is not a valid result.

5

Test a known application route

If the project provides a documented health route, login page, API route, or other known path, request it as well. Do not invent a health endpoint that the application does not implement.

curl -v http://127.0.0.1:3000/

Inspect the connection destination, status, headers, redirects, and response body. A redirect to an internal hostname, an unexpected port, or an incorrect scheme can later break browser behavior through the public HTTPS endpoint.

Interpret common local outcomes

  • Connection refused: no process accepts traffic at the selected address and port, or Docker did not publish the port as expected.
  • Connection timeout: the route may be filtered, directed to the wrong address, or unreachable from the client device.
  • Empty reply or reset: the application accepted the connection and then rejected it, exited, or expected another protocol.
  • 404 response: the network path works, but the requested route may not exist.
  • Host rejected: the framework may validate the request hostname. Add the required public hostname through the framework's documented and version-appropriate allowlist.
  • Redirect loop: the application may not understand the browser-facing scheme or host. Review canonical URL and trusted-proxy configuration.

Do not troubleshoot the public endpoint until the host-side request works consistently. If the Localtonet client runs on another device, perform the test from that device. The address 127.0.0.1 always refers to the device making the connection.

Configure the Localtonet HTTP tunnel

After the fixed host target works, follow the current Localtonet HTTP tunnel documentation. Use an HTTP tunnel for an HTTP or HTTPS web application. Raw TCP and UDP tunnels serve different forwarding requirements and should not be selected merely because HTTP ultimately runs over TCP.

The documented setup sequence is represented below without adding unsupported fields or commands.

1

Install and run the Localtonet client

Install the supported client for the host operating system and run it on the persistent device that can reach the published application port.

2

Open the HTTP tunnel page

Go to the HTTP tunnel configuration area in the Localtonet dashboard.

3

Select the process type

Select Random Sub Domain, Custom Sub Domain, or Custom Domain according to the options appropriate for your configuration. These process types serve the application through a public HTTPS address, but this article does not claim identical address-retention behavior across every process type or plan.

4

Select the AuthToken and server

Select the device-specific authentication token for the client that will run the tunnel, then choose a currently available server or region from the dashboard. Do not copy an old server code from a tutorial.

5

Enter the local IP address and port

Use the exact target already verified from the Localtonet client device. When Docker and the client run on the same host, this may be 127.0.0.1 and port 3000.

6

Press Start

Creating the configuration does not mean that it is running. Use the Start button, confirm that the selected client is connected, and test the public HTTPS address shown for that tunnel.

The operational rule is simple: when changing the application, restart or recreate the application container rather than deleting the tunnel. Continue using the existing tunnel configuration and its fixed local target.

Localtonet supports Random Sub Domain, Custom Sub Domain, and Custom Domain process types for HTTP tunnels. Exact custom-domain DNS instructions are not included because they must be checked against the current dashboard and documentation. Do not guess DNS records or values.

Preserving a configuration is different from promising an address forever

The fixed-target architecture means a container replacement does not itself require a different tunnel. It does not guarantee endpoint retention after stopping, deleting, or replacing the tunnel, changing process type, changing account conditions, or moving between unsupported configurations. Confirm the current public address before distributing it for a long-lived review.

Protect the device token and the application

The AuthToken identifies the client device and must remain secret. Do not put it in the application image, Compose file, repository, screenshot, command history, or tutorial output. A public URL is also not a substitute for application authorization.

Test restart and recreation without replacing the tunnel

The same tunnel and fixed host port serve an application before and after its container is replaced.
The controlled test changes the application container while leaving the existing tunnel configuration in place.

Test both a restart and a recreation before an important demonstration. They are not equivalent Docker operations. A restart stops and starts the existing container. A recreation replaces it and is the stronger test of whether you accidentally depended on container identity.

1

Establish a working baseline

Open the host-side URL and the Localtonet public URL. Confirm that they return the intended application and that its ordinary navigation and API requests work.

2

Record the current public address

Record the address shown for the existing running tunnel. Do not create a second tunnel for the test.

3

Restart only the application service

For a Compose project, use docker compose restart app after replacing app with the real service name. Leave the host-based Localtonet client and tunnel configuration unchanged.

4

Observe the expected interruption

Requests may fail while the application process is stopped. This temporary loss of application availability does not by itself mean that the public address changed.

5

Verify the host target again

Wait for startup to complete, read the application logs, and request the same host address and port.

6

Reopen the recorded public URL

Test the existing endpoint. If the client remained connected, the tunnel remained running, and the target returned on the same host port, no replacement tunnel should be needed.

7

Perform the project's normal recreation workflow

Rebuild or recreate the service using the project's established Compose workflow, then confirm that the replacement still publishes the same host port. Repeat the local and public tests without deleting the tunnel.

Docker documents Compose restart behavior separately from Compose up and recreation behavior. In particular, a restart does not apply changes made to the Compose configuration. If you changed ports, environment values, image settings, or other service configuration, use the project's appropriate docker compose up workflow so Docker can recreate the service.

Expected behavior during the interruption

A reviewer may see a browser error, failed fetch, gateway-style response, or stalled request while the application is absent. The exact browser symptom does not identify the failed layer. Check the host target first. Once it returns, reload the same public URL before changing the tunnel.

If the host URL works but the public URL does not, inspect the Localtonet client and tunnel state. If both fail, continue troubleshooting the application and Docker layers. Recreating a tunnel while the host target is broken introduces another variable without repairing the local service.

Understand WebSockets, mixed content, and hot module replacement

HTTP requests and a WebSocket connection pass through the tunnel to a containerized development server.
Page delivery and the long-lived development WebSocket are separate operations and must be tested separately.

A page can load while hot module replacement, live reload, or another real-time feature remains disconnected. These features commonly use a WebSocket connection separate from the requests for HTML, JavaScript, stylesheets, and APIs.

A WebSocket connection starts with an HTTP handshake and then upgrades to a persistent bidirectional connection. The WebSockets standard defines browser-facing WebSocket behavior. When a page is delivered over public HTTPS, its browser-facing socket normally needs the secure wss:// scheme. An insecure ws:// request from a secure page can be blocked under browser mixed-content rules.

HMR behavior is framework-specific and version-specific. Some development servers derive the socket hostname, scheme, and port from the page URL. Others use explicit client settings, environment values, reverse-proxy configuration, or data injected into the client bundle. There is no universal HMR option that applies safely to Vite, Next.js, webpack development servers, and every other framework version.

Inspect the browser rather than guessing

Open the Console and Network panels in browser developer tools. Filter for WebSocket traffic and answer these questions:

  • Does the browser attempt a WebSocket connection?
  • Does it use wss:// when the page is loaded over public HTTPS?
  • Does the hostname match the public application hostname?
  • Does it incorrectly use localhost, a Docker service name, or a private address?
  • Does it use the intended browser-facing port and path?
  • Does the handshake return an error, close immediately, or stay connected?
  • Does saving a source file cause the server to send an update?

A remote browser interprets localhost as the reviewer's own device. If generated client code attempts to connect to ws://localhost:3000, it is not returning through the Localtonet endpoint. Use the current documentation for the exact framework version to configure its browser-facing HMR host, protocol, port, path, public origin, or reverse-proxy behavior.

Separate page delivery from HMR delivery

Observed behavior Area to inspect Next check
The page and assets do not load Application, Docker publishing, client connection, or tunnel target Repeat the host-side request before investigating HMR.
The page loads but the socket uses localhost Generated HMR client configuration Configure the framework's documented public client URL behavior.
The browser reports mixed content Browser-facing WebSocket scheme Review why an HTTPS page is attempting an insecure socket.
The handshake reports a host or origin error Development-server host validation or origin policy Allow the exact required hostname or origin using current framework documentation.
The socket connects but updates never arrive File watching, rebuild generation, or HMR subscription Verify that local HMR detects and delivers the same change.
The socket disconnects after recreation Application readiness and browser reconnection behavior Wait for the host target to return, reload, and inspect the new handshake.

Host validation, CORS, and WebSocket origin checks are different

A development server may validate the HTTP Host value. An API may separately enforce Cross-Origin Resource Sharing rules. A WebSocket implementation may inspect the Origin value during its handshake. These mechanisms are related to request acceptance but are not interchangeable.

If the application rejects the public hostname, add the exact required value through its documented, version-appropriate configuration. Avoid disabling host or origin validation globally. A temporary development server is still public while the tunnel is running.

Forwarded headers and trusted proxies

An application behind a public HTTPS endpoint may accept a local HTTP connection while the browser sees HTTPS. Applications sometimes use proxy-provided forwarding information to generate redirects, absolute links, callback URLs, secure cookies, and WebSocket endpoints. The standardized Forwarded HTTP extension describes one such header format, while frameworks may also support other conventions.

This article does not claim which forwarding headers Localtonet supplies or how a particular framework interprets them. Inspect the request information received by your application and consult the current Localtonet and framework documentation before relying on any header.

Do not enable unrestricted proxy trust as a reflex. Frameworks differ in how they determine which proxy hops are trusted, and incorrect trust can allow client-supplied forwarding values to influence scheme detection, host generation, IP-based controls, or security decisions. Configure only the trust relationship required for the verified deployment path.

File watching can fail even when the socket works

HMR has at least two independent sides. The server must detect a changed file and generate an update, and the browser must receive and apply that update. Bind mounts, host filesystem behavior, editor save strategies, polling settings, framework versions, and watcher implementations can affect detection.

Test HMR through the host URL first. If local HMR also fails, investigate file watching and the development server. If local HMR works but public HMR fails, compare the local and public WebSocket requests, including their scheme, host, port, path, origin, response status, and connection lifetime.

Verify real-time behavior with the actual project

A successful HTML response is not proof that WebSockets or HMR work. Test the real handshake and a real source change. Required settings can vary between frameworks, releases, development modes, and project configurations.

Troubleshoot from the application outward

An inside-out diagnostic flow checks the application, Docker mapping, local target, tunnel, public response, and WebSocket.
Find the first failing boundary before changing a later layer.

Change one layer at a time. Simultaneously changing the application bind address, Docker mapping, Localtonet target, hostname policy, and proxy settings makes the result difficult to interpret.

1. Confirm the application process

Read the current logs. Confirm that the process remains running, finishes startup, and reports the expected internal port. Resolve compilation failures, missing dependencies, occupied ports, failed backend connections, and restart loops first.

2. Confirm the application bind address

If the development server listens only on container loopback, published traffic may not reach it. Use the project's supported and version-appropriate setting to select a reachable interface.

3. Confirm the published-port mapping

docker compose ps

Verify both sides of the mapping. A common mistake is publishing host port 3000 to container port 3001 while the process actually listens on 3000. Another is editing the Compose file and using only docker compose restart, which does not apply the changed configuration.

4. Test the exact Localtonet target locally

curl -v http://127.0.0.1:3000/

Run the test from the Localtonet client device. If it fails there, repair the local route before changing the tunnel.

5. Confirm that the selected Localtonet client is connected

Our client establishes an outbound connection to a Localtonet relay. The standard tunnel workflow does not require inbound router port forwarding, a public IP address, VPN setup, or inbound firewall changes. The client still needs working outbound connectivity and must remain connected.

6. Confirm that the existing tunnel is running

Creating a configuration does not automatically start it. Confirm the tunnel state, use Start when necessary, and verify its selected AuthToken, server, local IP address, and local port.

7. Test ordinary HTTP first

Open the public root page and a known application route. If ordinary HTTP fails, WebSocket testing is premature.

8. Record browser failures precisely

Record the failing URL, scheme, hostname, port, path, status, response, and console message. β€œHMR is broken” does not distinguish a missing connection attempt from an incorrect URL, rejected handshake, disconnected socket, or absent file-change event.

9. Review host, origin, and proxy policy

Configure only the hosts, origins, callback URLs, and proxy relationships the application needs. Use documentation for the exact framework and version rather than copying a broad allow-all setting.

10. Repeat the test after recreation

Recreate the application container and repeat the local and public checks. This confirms that the design does not depend on a stale private address, automatically allocated host port, or one-time process state.

Symptom Best first test Likely correction
Both public and host URLs fail Container logs and host-side curl Start the app, correct its bind address, or repair port publishing.
The host URL works but the public URL fails Localtonet client and tunnel state Reconnect the selected device, start the existing tunnel, or correct its target.
The path fails only after container recreation Compare the published-port mapping Use an explicit host port and avoid targeting a container address.
The public page reports that the host is not allowed Framework logs and host-validation configuration Allow the exact public hostname using current framework documentation.
Redirects use HTTP or an internal hostname Inspect response locations and generated URLs Review canonical URL and trusted-proxy configuration.
The page works but API requests fail Browser Network and Console panels Correct the API base URL, authentication, route, or origin policy.
HMR points to localhost Inspect the generated WebSocket URL Configure the framework's public HMR client settings.
HMR works locally but not publicly Compare both WebSocket handshakes Review secure WebSocket, host, origin, path, and proxy-aware behavior.
The socket connects but no update appears Test local file-change detection Repair volume or watcher behavior before changing the tunnel.

Expose development previews safely

A public preview is public infrastructure, even when it is temporary. Avoiding router port forwarding does not make the application private. Localtonet provides a public route to the selected service while the client is connected and the tunnel is running. Application authorization and safe configuration remain your responsibility.

  • Do not expose environment files, secret-management pages, database consoles, debug dashboards, or administrative routes.
  • Use application authentication when a preview contains non-public data or privileged actions.
  • Create limited test accounts instead of sharing production credentials.
  • Use synthetic or sanitized data where possible.
  • Review upload, webhook, form submission, account creation, and destructive-action behavior.
  • Restrict accepted hosts and origins to the values the preview needs.
  • Keep Localtonet device tokens out of images, repositories, Compose files, logs, and screenshots.
  • Stop the tunnel when access is no longer required.
  • Delete the tunnel only when the configuration and any continuity associated with it are no longer needed.

Apply least privilege to surrounding services as well. A development server that can reach production databases, cloud metadata endpoints, local secret files, privileged Docker sockets, or administrative networks requires additional isolation. Expose only the intended application service, not a broad network path.

An unguessable-looking URL is not authentication

A shared URL can appear in chat logs, browser history, issue trackers, screenshots, analytics, and referrer data. Protect sensitive previews with real authorization and remove access when the review ends.

Operational checklist

  • The application works at the exact host-side target.
  • The container uses an explicit host-port mapping.
  • The tunnel points to the host mapping rather than a private container address.
  • The Localtonet client runs independently from the disposable application container.
  • The selected device is connected and the existing tunnel is running.
  • The public page, assets, API calls, authentication flow, and redirects have been tested.
  • Required WebSockets use the intended public scheme, hostname, port, and path.
  • Host and origin policies allow only the values the application needs.
  • The application contains no exposed secrets or unsafe debug functionality.
  • A normal restart and a full recreation have both been tested against the existing public address.
  • The current process type and dashboard behavior have been checked before promising a long-lived address.

Frequently asked questions

Will restarting my application container change the Localtonet URL?

Restarting or recreating the application container does not require a new tunnel when you keep the existing Localtonet configuration and fixed local target. This avoids coupling the endpoint to the container identity. It is not an unconditional guarantee that an address will survive every process type, plan, client version, account state, tunnel stop, deletion, or recreation. Verify the current address shown for the existing tunnel before distributing it.

Will the application remain available during the restart?

Not with a single application instance. Requests can fail between the old process stopping and the replacement becoming ready. Preserving a tunnel configuration does not provide application high availability.

Is stopping a tunnel the same as restarting the container?

No. Restarting the container changes the application behind the target. Stopping the tunnel changes the Localtonet tunnel's running state. This article does not promise that every address will be retained through every tunnel stop-and-start lifecycle. If continuity matters, avoid unnecessary tunnel changes and validate the selected process type.

What happens if I delete and recreate the tunnel?

Deleting removes the existing tunnel configuration. A newly created tunnel is a different lifecycle event from restarting an application container, and this guide does not claim that it will receive the previous address. Delete a tunnel only when you no longer need that configuration.

Should the tunnel target the container's private address?

Usually not when the Localtonet client runs on the Docker host. Container addresses can change during recreation. Publish the service through a fixed host port and target that host-side address instead.

Can I bind the published Docker port to 127.0.0.1?

Yes, when the Localtonet client runs on the same host. A mapping such as 127.0.0.1:3000:3000 lets host processes reach the service without deliberately publishing it on every host interface. If the client runs on another device, that device cannot reach the Docker host's loopback address.

Why does the page load while hot reload fails?

Page delivery and HMR are separate operations. The page may load over public HTTPS while the framework-generated HMR client uses localhost, a private hostname, the wrong port, an incorrect path, or an insecure ws:// URL. Inspect the actual WebSocket request and use documentation for the exact framework version.

Does a connected WebSocket prove that file watching works?

No. The development server must detect a change and generate an update before the socket can deliver it. If HMR fails through the host URL too, investigate bind mounts, filesystem events, editor behavior, watcher configuration, and framework-specific settings.

Does creating a Localtonet tunnel start it automatically?

No. Configuration and runtime state are separate. Use the Start button, keep the selected Localtonet client connected, and confirm the tunnel state before testing the public address.

Does this workflow require router port forwarding?

No. The Localtonet client establishes an outbound connection to our relay server. Standard tunneling does not require inbound router port forwarding, a public IP address, VPN setup, or inbound firewall changes. The client still needs outbound connectivity and access to the configured local target.

Should I run the Localtonet client inside the application container?

Not for the lifecycle-separation pattern described here. Running the client on the host or another persistent device lets the application container be replaced without also replacing the client. A separate containerized client requires independently verified installation, authentication, persistence, networking, and restart behavior.

Keep your preview configuration independent

Run our client outside the disposable application container, point an HTTP tunnel at a verified fixed host port, and preserve the existing tunnel configuration while you rebuild the application behind it.

Get Started Free β†’

Corrections & updates

Substantive changes approved by the Localtonet editorial team are listed transparently below.

Remove the outer <article> wrapper; move the opening figure to a relevant section so the hero appears first and the guide-navigation card follows it immediately; audit the HTTP tunnel steps against current Localtonet documentation and add a descriptive documentation link; qualify URL continuity by process type and tunnel lifecycle without inventing plan or persistence guarantees; make clear that deleting or replacing a tunnel is different from restarting the application container; retain the fixed host-port architecture and layered ve

Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.

support