Skip to content

Self-Host tapflow Relay with Docker and Localtonet

Deploy and verify the tapflow relay with Docker, then expose its dashboard and WebSocket traffic securely through a Localtonet HTTP tunnel.

Summary in your language
In this article 11 sections
Self-Hosting · tapflow Relay · Docker · Localtonet · 2026

Deploy a dedicated relay, prove the local endpoint works, and expose it only after its access controls are verified

tapflow is an open-source platform for streaming iOS simulators and Android emulators into a browser. This guide focuses specifically on running its relay in Docker, validating the relay on the Docker host, and conditionally publishing that verified HTTP endpoint through Localtonet. It does not treat the tapflow all-in-one CLI workflow as a documented method for connecting a remote agent to a separate relay. Where the current public project material does not establish a required authentication, persistence, or agent-enrollment setting, we identify that boundary rather than inventing configuration.

🔒 Public exposure requires verified tapflow authentication 🌐 Localtonet carries remote traffic to the operator-hosted relay ⚡ Local HTTP and interactive-session checks before tunneling

What this tutorial can verify

This article was reviewed against the public tapflow repository, including its README, documentation tree, Dockerfile, changelog, and published release information available in October 2026. The repository identifies tapflow as a self-hosted platform for browser access to iOS and Android simulator environments. It also contains separate relay, dashboard, CLI, agent, flow-runner, and MCP-related areas, so commands and tokens associated with one component must not automatically be applied to another.

The supported scope here is deliberately narrower than a complete distributed tapflow installation. We run the published relay image, publish its container port 4000 to a selected host address, verify the HTTP service, and explain how to point a Localtonet HTTP tunnel at that service. The examples use the upstream image name tapflow/tapflow:latest for evaluation because the reviewed material identifies that image workflow, but a mutable tag is not a repeatable production version.

The current evidence available for this revision does not establish all of the following as stable, release-independent interfaces:

  • An exact CLI flag, environment variable, or enrollment command that connects a remote simulator agent to a dedicated Docker relay.
  • A minimum supported Docker, Node.js, npm, Xcode, Android SDK, operating-system, CPU, memory, or host-architecture version.
  • A documented application authentication procedure that protects every dashboard, session, device-control, recording, build, or run endpoint.
  • An official container directory that should be mounted for persistent relay data.
  • A guarantee that the Git release tag and Docker image tags use identical names.
  • A complete set of release-specific relay environment variables or configuration files.

Those omissions matter. A relay can be demonstrated locally without guessing them, but a reliable remote-agent deployment and safe public rollout require the exact instructions for the selected tapflow release. Review the current tapflow README, the repository's documentation directory, its Dockerfile, and the tapflow release history before treating an evaluation command as production configuration.

This guide does not invent the missing remote-agent connection setting

The commands tapflow setup and tapflow start may represent an all-in-one local workflow rather than enrollment into an independently hosted relay. Do not run them on a simulator machine and assume that machine has connected to the Docker relay. Continue to public exposure only after the deployed tapflow version documents the correct relay address, enrollment method, and authentication behavior and you have verified them locally.

How the relay architecture fits together

Docker-hosted tapflow relay connected to a simulator environment and a remote browser through a Localtonet tunnel.
The tapflow application remains operator-hosted, while remote browser traffic traverses a Localtonet relay before reaching the Docker host.
Architecture separating the simulator host, Docker relay, Localtonet client, Localtonet relay, and remote browser.
Keep the simulator environment, tapflow relay, tunnel transport, and remote browser distinct when diagnosing connectivity or authorization.

The relay is the network-facing portion of a tapflow deployment. The reviewed Docker workflow publishes the relay service on container port 4000, with the local dashboard expected at http://localhost:4000 when the same host port is used. The relay container does not create an iOS simulator, Android emulator, Xcode installation, or Android development environment.

At least one separately prepared machine must provide the mobile environment. iOS simulator workloads require an appropriate Apple host and toolchain. Android workloads require a functioning Android emulator environment. Whether that machine starts a complete local tapflow stack or connects as an agent to the dedicated relay depends on tapflow's release-specific instructions.

🐳 Dedicated relay container Docker runs the network service independently from the machines that provide iOS simulators or Android emulators.
📱 Separate mobile environment The relay image does not replace Xcode, an iOS simulator host, the Android SDK, or an Android emulator host.
🖥️ Browser-facing endpoint The local HTTP endpoint provides the first health check, but a loaded page does not prove that a mobile agent or interactive stream works.
🌐 Optional public transport A Localtonet HTTP tunnel can carry remote browser requests to the verified relay without an inbound router port-forwarding rule.

There are also two different access paths to consider. An agent on another LAN machine needs a route to the Docker host. A remote browser using Localtonet connects to the public HTTPS address assigned to the HTTP tunnel. Those paths may terminate at the same relay port, but they have different trust boundaries and should not be configured interchangeably.

An HTTP response is only the first checkpoint

A complete tapflow test must verify the dashboard, the intended authentication flow, the simulator or emulator connection, and an interactive session. Use browser developer tools and relay logs to confirm any persistent connection used by the deployed version instead of assuming that a successful home page proves streaming works.

Prerequisites and network decisions

Relay host

  • A working Docker installation with permission to pull and run images.
  • A host port that can be mapped to container port 4000.
  • A browser and an HTTP client such as curl for local checks.
  • A Localtonet client on the Docker host, or on another device that can reach the published host port.
  • A reviewed tapflow release and a record of the exact container image digest used.
  • A confirmed tapflow authentication and authorization configuration before public exposure.

This guide does not prescribe hardware or runtime minimums because the reviewed public material does not provide stable values that can safely be generalized across releases. Check the selected release before installing on an older Docker engine, an unusual CPU architecture, or a resource-constrained host.

Simulator or emulator host

The mobile host must meet the requirements of the platform it provides. It also needs the tapflow component and connection mode documented for your selected version. Do not use this article as evidence that a particular Node.js, npm, Xcode, Android SDK, macOS, Linux, or Windows version is supported.

Choose the Docker publishing boundary

Port mapping Appropriate use Security consequence
127.0.0.1:4000:4000 Local evaluation and a Localtonet client on the Docker host The host port is limited to loopback, so separate LAN agents cannot directly reach it.
4000:4000 A documented remote-agent design that requires LAN access Docker commonly publishes the port on host interfaces. Review firewall rules and limit source access.
127.0.0.1:8080:4000 Loopback-only access when host port 4000 is unavailable Browsers and Localtonet target host port 8080 while the container still listens on 4000.

Docker warns that published ports can become reachable outside the host depending on the selected bind address and firewall arrangement. Review Docker's port-publishing documentation before using an all-interface mapping. Prefer loopback for the initial relay test.

Deploy the tapflow relay with Docker

The upstream image's mutable latest tag was reviewed in October 2026. The public tapflow release evidence also included release v0.28.0, but that does not prove that a Docker image tag named v0.28.0 exists. Git tags and registry tags must be checked independently.

1

Pull the published evaluation image

Pull tapflow/tapflow:latest, then record the repository digest Docker reports. The tag is convenient for evaluation, but the digest identifies the exact downloaded image.

2

Start the relay with a reviewed port mapping

Begin with loopback publishing when the browser and Localtonet client run on the Docker host. Use a LAN-reachable mapping only after the tapflow agent instructions establish that another machine must connect directly.

3

Confirm the container remains running

Check Docker's running-container list and inspect the logs. An image that pulled successfully but exits at startup has not produced a working relay.

Pull and identify the image

docker pull tapflow/tapflow:latest
docker image inspect \
  --format='{{index .RepoDigests 0}}' \
  tapflow/tapflow:latest

Save the reported repository digest with your deployment notes. A digest normally has the form of the repository name followed by @sha256: and a hash. Use the actual value Docker reports. Do not copy a digest from another architecture or invent one.

Start a loopback-only evaluation relay

docker run --detach \
  --name tapflow-relay \
  --publish 127.0.0.1:4000:4000 \
  tapflow/tapflow:latest

The name tapflow-relay is an operator-selected Docker name. It is not a tapflow setting. This command maps host loopback port 4000 to container port 4000 and does not add guessed environment variables or volume paths.

Use LAN publishing only when the documented agent mode requires it

docker run --detach \
  --name tapflow-relay \
  --publish 4000:4000 \
  tapflow/tapflow:latest

This broader mapping may make the relay reachable from other machines. Restrict access with host and network firewall controls instead of opening the port to every source. If the Localtonet client runs on the Docker host and remote agents are not required, the loopback mapping is the safer default.

Check status and startup logs

docker ps --filter name=tapflow-relay
docker logs tapflow-relay

If the container is absent from the running list, include stopped containers:

docker ps --all --filter name=tapflow-relay
docker logs tapflow-relay

Resolve the first actionable startup error. A port allocation error usually means another service already owns the selected host port. An architecture, configuration, or runtime error must be checked against the selected tapflow release instead of being worked around with guessed settings.

No persistence mount is added here

The reviewed material does not establish an official relay data directory that can safely be mounted for every current deployment. The minimal command stores any container-local files in the container's writable layer. Do not rely on that layer for builds, recordings, run records, credentials, or other important state. Find and follow the persistence instructions for your exact tapflow release before removing the container or using it for retained work.

Distinguish the all-in-one CLI from a remote agent

tapflow documents an npm-based user workflow with these commands:

npm install -g tapflow
tapflow setup
tapflow start

These commands install the CLI, prepare the local environment, and start tapflow according to the CLI's current behavior. They must not be described as a verified remote-agent enrollment procedure for the separate Docker relay. In particular, tapflow start may start a local or all-in-one stack. If that happens, a browser test could accidentally reach the local stack instead of the dedicated container.

Workflow What is established What must still be verified
Docker relay Runs the relay service and publishes container port 4000 Release-specific settings, persistence, and application authentication
All-in-one CLI Uses tapflow setup and tapflow start to prepare and start the local workflow Which components start and which local endpoint they own in the installed version
Remote simulator agent Requires a simulator or emulator machine and a route to the intended relay The exact relay address option, enrollment process, credentials, and supported versions

Before connecting a simulator host, locate the remote-agent instructions for the exact release and answer four questions: which process runs on the mobile host, how it receives the relay URL, how it authenticates, and how the dashboard identifies successful enrollment. If the documentation does not answer those questions, the distributed deployment is blocked at this point.

Network addressing alone is not enough. A separate agent cannot use localhost:4000 to reach the Docker host because localhost refers to the agent machine itself. It needs a reachable address for the Docker host, but that address must be supplied through the mechanism tapflow actually documents. Do not invent a command-line flag or environment variable merely because the network address is known.

Do not confuse MCP credentials with relay authorization

The v0.28.0 release notes mention MCP token commands and credential-file behavior. That evidence concerns the MCP-related component. It does not prove that the same token authenticates dashboard users, simulator agents, relay API calls, or browser sessions.

Verify the relay locally

Local verification sequence checking the Docker container, tapflow dashboard, simulator connection, and interactive browser session.
Validate each local layer before adding the public tunnel so tunnel errors remain distinguishable from application errors.

Use a normal HTTP GET request

Open http://localhost:4000 in a browser on the Docker host. If another host port was selected, use that port. Then issue a regular GET request:

curl --include http://localhost:4000/

A GET request is preferable to assuming that tapflow implements the HTTP HEAD method. Look for an HTTP response from the intended service rather than requiring one particular status code. Redirects or application routing can affect the result.

A connection-refused error means no process accepted the connection at that address. A timeout suggests a routing or filtering problem. An unexpected page can mean another application owns the host port.

Confirm the port belongs to the relay container

docker ps --filter name=tapflow-relay
docker port tapflow-relay
docker logs tapflow-relay

Compare the published host port with the URL you tested. For example, 127.0.0.1:8080:4000 must be tested at http://localhost:8080.

Test authentication before public exposure

Open the relay in a private browser session with no tapflow cookies. Confirm that an unauthenticated visitor cannot obtain access that should be restricted, including device lists, session views, controls, builds, recordings, flow runs, or administrative actions.

If the deployed version presents no confirmed application authentication or authorization mechanism, stop here. A working local page is not sufficient justification to create a public tunnel. Keep the relay on loopback or another controlled private network until tapflow's documentation provides a suitable access-control design.

Run a complete local mobile session when an agent is available

After following the release-specific agent instructions, verify all of the following:

  • The intended simulator or emulator appears in the dashboard.
  • The agent is connected to the Docker relay, not to an accidental local relay.
  • A live frame loads and continues updating.
  • Interactions supported by the deployed release reach the mobile environment.
  • The session remains connected beyond the initial page load.
  • The browser's network panel shows the persistent connection remaining healthy.
  • Container and agent logs do not show repeated authorization or reconnect failures.

Do not hardcode a WebSocket path unless your deployed version documents it. Browser developer tools can identify the actual request URL, status, and frames used by that release. This end-to-end session is more useful than attempting to simulate the application protocol with a generic command-line request.

Expose the verified relay with Localtonet

Remote HTTPS and persistent application traffic passing through a Localtonet relay to the private tapflow Docker endpoint.
Localtonet provides the transport path, while tapflow remains responsible for authenticating users and authorizing access to devices and sessions.

Continue only after the relay works locally, the intended agent connects to that relay, a full session succeeds, and tapflow authentication has been confirmed. For the current product workflow, see our HTTP tunnel documentation.

The Localtonet client creates an outbound connection to a Localtonet relay server. You do not need to configure inbound router port forwarding, obtain a public IP address, change the router firewall for a new public listener, or set up a VPN.

1

Install and run the Localtonet client

Run the client on the Docker host for the simplest loopback deployment, or on another device that can reach the Docker host's published port.

2

Select the authenticated client device

Use the device-specific authentication token through the supported client workflow, then select that connected device for the tunnel. Never copy its token into public documentation, screenshots, repositories, or support logs.

3

Select an available Localtonet server

Choose a server or region shown in the current dashboard. Do not copy a hardcoded server code from an old tutorial because availability can vary.

4

Create the HTTP tunnel and enter the local target

Create an HTTP tunnel pointing to 127.0.0.1 and port 4000 when the Localtonet client and loopback-published container share a host. If the client runs elsewhere, use the Docker host's reachable private address and selected host port. Choose Random Sub Domain, Custom Sub Domain, or Custom Domain according to the current options available to you.

5

Start and verify the tunnel

Creating the tunnel does not start it. Press Start, open the assigned public HTTPS address in a private browser session, authenticate through tapflow, and test a complete interactive session. The endpoint is available only while the selected client remains connected and the tunnel is running.

The target is resolved from the Localtonet client device

If the client runs on another computer, 127.0.0.1:4000 points to that computer rather than the Docker host. Test the Docker host's private address and published port from the client device before creating the tunnel.

Perform an end-to-end public test

  • Open the public HTTPS address in a browser without an existing tapflow session.
  • Confirm that the expected authentication challenge appears before protected resources.
  • Sign in with a least-privilege test account or credential supported by tapflow.
  • Confirm that the intended device appears without exposing unrelated resources.
  • Start a session and verify that frames continue updating.
  • Exercise only the controls the test user is supposed to have.
  • Inspect the browser network panel for failed or repeatedly reconnecting persistent requests.
  • Review relay logs for errors without publishing sensitive log content.

If the page loads but a session does not become interactive, compare the public test with the known-good local test. An ordinary HTML response proves only that HTTP reached the relay. It does not prove agent connectivity, application authorization, or a healthy long-lived stream.

Security and the real data boundary

tapflow remains self-hosted in the sense that you operate the relay and simulator infrastructure. That statement must be qualified after remote access is enabled. Browser requests, application stream traffic, and user interactions sent through the public endpoint traverse a Localtonet relay before reaching the Localtonet client and the operator-hosted tapflow service.

Therefore, a public Localtonet deployment should not repeat an unqualified claim that all traffic remains solely inside the operator's private network. App binaries and simulator data may remain on operator-controlled hosts depending on tapflow's behavior, but remote traffic is transported across Localtonet infrastructure when the tunnel is used.

Separate transport from authorization

Localtonet supplies the network route to the local HTTP service. It does not automatically define which tapflow user may list devices, watch a session, control a simulator, access a recording, retrieve a build, or perform administrative actions. Those decisions belong to tapflow's application authentication and authorization model.

Confirm that model before pressing Start on the tunnel. Use least-privilege users, roles, or scopes when the deployed tapflow version supports them. Do not treat an obscure public URL as a password, and do not substitute an agent or MCP token for browser authorization unless tapflow explicitly documents that use.

Limit the local surface

  • Prefer a loopback Docker mapping when the Localtonet client runs on the same host.
  • If agents require LAN access, permit only the required private source machines or networks.
  • Do not expose unrelated Docker services, databases, host administration ports, or simulator management interfaces.
  • Protect the Docker host and mobile hosts with current operating-system security updates.
  • Keep development secrets and production credentials out of simulator test data where possible.

Protect credentials and operational data

  • Never share a Localtonet device token.
  • Do not publish tapflow login credentials, enrollment tokens, session URLs, or internal hostnames.
  • Review logs before attaching them to an issue or support request.
  • Use the documented rotation procedure if a credential is exposed.
  • Stop the public tunnel when the remote-access window ends.
Authentication is a prerequisite, not a post-deployment task

Do not start a public tunnel merely to discover whether tapflow requires a login. Test authentication and authorization locally first. If an unauthenticated private-browser session can view or control sensitive resources, keep the service private until a supported application-level control is configured.

Operate, update, and roll back carefully

Read and follow logs

docker logs tapflow-relay
docker logs --follow tapflow-relay

Logs are useful when reproducing agent, browser, or persistent-connection failures. Review them for credentials, identifiers, internal addresses, and session information before sharing them.

Stop, start, or restart the existing container

docker stop tapflow-relay
docker start tapflow-relay
docker restart tapflow-relay

Stopping the container makes the local target unavailable. A Localtonet tunnel may remain configured, but it cannot deliver a functioning application while the target is stopped. Stop the tunnel as well when maintenance is intentional.

Use a recorded image digest for repeatability

Pulling latest later can retrieve a different image. For a repeatable deployment, recreate the reviewed container from the exact repository digest recorded during validation, provided that the digest exists for the host architecture. The image reference should use the real value reported by Docker, not a placeholder copied from an article.

Do not assume that Git release v0.28.0 maps to a Docker tag of the same name. Check the image registry and upstream release instructions. If upstream publishes a documented immutable version tag or digest, prefer it over latest.

Plan an upgrade without destroying unknown state

A safe upgrade begins with reading the release notes between the deployed and intended versions. Check for changes to relay configuration, authentication, agent compatibility, stored data, dashboard behavior, and persistent connections. Confirm the documented backup and persistence process before removing the existing container.

The minimal evaluation container in this guide has no verified volume mount. For that reason, this article does not recommend removing it as a routine upgrade step. First determine whether it contains state that must be preserved. Then follow the selected release's migration procedure.

After an upgrade, repeat the local GET request, private-browser authentication check, agent enrollment check, complete local session, and complete public session. Keep the public tunnel stopped until those checks pass.

Understand the rollback boundary

Retaining the previous image digest can make the executable image available for rollback. It does not guarantee that application data remains backward-compatible after a newer release changes it. Roll back only when tapflow's release documentation supports the data path involved and a suitable backup exists.

Troubleshooting the relay and tunnel

The container exits immediately

docker ps --all --filter name=tapflow-relay
docker logs tapflow-relay

Start with the first actionable error. If the host port is occupied, choose another host port such as 8080 while retaining container port 4000. If the error concerns architecture, runtime compatibility, or missing tapflow configuration, use the selected release's documentation rather than adding speculative options.

Nothing responds on localhost

Confirm that the test runs on the Docker host and uses the published host port. A mapping of 127.0.0.1:8080:4000 is reached at http://localhost:8080. Another machine's localhost never refers to the Docker host.

The dashboard loads, but no device appears

A responsive dashboard proves only that the relay web service is available. Confirm that the simulator host meets its platform requirements and is using the release-specific remote-agent procedure. Check that tapflow start did not launch a separate local relay that is being mistaken for the Docker service.

If the agent is on another machine, verify that the Docker port is reachable from that machine and that firewall rules permit only the intended source. Network reachability still does not replace agent enrollment or authentication.

The local service works, but the public address does not

Confirm that the selected Localtonet client is connected and that the tunnel was started. Test the configured local target from the client device. Use 127.0.0.1 only when the client and loopback-published container share a host.

Also confirm that an HTTP tunnel was created and that the selected target port matches Docker's host-side mapping. Check the current dashboard for the assigned public address and server selection rather than reusing old values.

The public page loads, but streaming or interaction fails

Reproduce the failure while watching the browser network panel, browser console, relay logs, and agent logs. Compare the failed public session with a successful local session. Look for repeated reconnects, authorization responses, an application-generated private URL, or a disconnected agent.

Avoid hardcoding a guessed WebSocket route. Record the actual request URL and response shown by the deployed browser application. If the same session fails locally, resolve the tapflow or agent issue before changing the tunnel.

A public visitor can access the dashboard without the intended authentication

Stop the Localtonet tunnel immediately. Do not rely on keeping the URL secret. Review tapflow's authentication documentation for the deployed release and configure application-level protection before starting the tunnel again.

The deployment stopped working after a host restart

The Docker container, Localtonet client, and Localtonet tunnel have separate lifecycles. Confirm each one independently. This guide does not prescribe automatic startup options because the correct service manager and tapflow restart behavior depend on the host and release.

An update appears to have removed data

Stop making destructive changes and check whether the previous container still exists. Data stored only in a removed container's writable layer may be unavailable. Restore from a verified backup if one exists, then apply the persistence and migration guidance for the exact tapflow release. Do not mount a guessed internal directory after data loss.

Frequently asked questions

Does the relay container include iOS simulators or Android emulators?

No. The relay container provides the network service. An appropriately prepared machine must provide the iOS simulator or Android emulator and connect using the procedure documented for the deployed tapflow release.

Do tapflow setup and tapflow start connect a remote agent to the Docker relay?

Do not assume so. Those commands document the tapflow CLI's setup and startup workflow, but they may start an all-in-one local stack. Use the exact remote-agent or relay-enrollment instructions for your version and verify which relay the agent actually reaches.

Why does this guide use latest if mutable tags are discouraged?

It reflects the reviewed upstream evaluation workflow. After pulling it, record the repository digest and use an upstream-documented immutable tag or digest for a repeatable deployment. Do not assume that a Git release tag is also a valid Docker tag.

Does the minimal Docker command preserve relay data?

It should not be assumed to preserve important data after container removal. The command has no volume because an official persistence path was not established for this guide. Follow the exact release's persistence and backup instructions before retaining work or replacing the container.

Should tapflow use a Localtonet HTTP or TCP tunnel?

Use an HTTP tunnel for the documented browser-facing HTTP endpoint. Then test a complete interactive session through the public HTTPS address because loading the initial page does not prove that the application's persistent traffic and agent connection are healthy.

Does Localtonet keep all tapflow traffic inside my private network?

No. The tapflow relay and simulator infrastructure remain operator-hosted, but browser requests, stream traffic, and remote interactions sent through the public endpoint traverse a Localtonet relay. That transport path must be included in the deployment's data-boundary and security review.

Does Localtonet provide tapflow user authorization?

No. Localtonet provides the network path to the configured local endpoint. tapflow remains responsible for authenticating users and deciding who may view, control, or administer its resources. Confirm those controls before starting the tunnel.

Can the Localtonet client run on another machine?

Yes, if that device can reach the Docker host's published port. Configure the tunnel with the Docker host's reachable private address rather than 127.0.0.1, and restrict the LAN exposure to the required source devices.

Is a Localtonet tunnel active immediately after it is created?

No. Creating a tunnel does not start it. Press Start after reviewing the target and confirming tapflow authentication. The tunnel remains available only while it is running and the selected Localtonet client is connected.

Connect a verified tapflow relay with Localtonet

First prove the Docker relay, application authentication, documented agent connection, and complete mobile session locally. Then create an HTTP tunnel to the verified endpoint and repeat the authentication and interactive-session tests through the assigned public HTTPS address.

Get Started Free →

Corrections & updates

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

Reviewed and updated for accuracy and completeness.

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