21 min read

Expose a Self-Hosted Chat Server with Localtonet

Publish Mattermost, Rocket.Chat, or Matrix through an outbound Localtonet tunnel without port forwarding, firewall changes, a VPN, or a public IP.

Tunneling · Self-Hosted Chat · Localtonet · 2026

Publish an already working chat service without opening inbound router ports

This guide starts after your chat server has been installed and verified locally. It explains how to expose its user-facing web endpoint with Localtonet, prepare the application for a public HTTPS address, test real-time messaging, and recover safely from configuration problems. Browser chat, federation, and voice or video are separate deployment scopes. We also identify the configuration details that must be confirmed for your installed application before treating the deployment as production-ready.

🔒 No inbound router port forwarding 🌐 Public HTTPS access to a local web service ⚡ Outbound connection from our client

What this tutorial covers

This tutorial covers publication of an existing, locally functional chat deployment. It does not install Mattermost, Rocket.Chat, a Matrix homeserver, or their databases. Before introducing a tunnel, your application must start successfully, connect to its dependencies, and allow two local sessions to exchange messages.

Localtonet changes the direction of the network connection. Our client runs on a device that can reach the application and establishes an outbound connection to a Localtonet relay. A running HTTP tunnel provides a public HTTPS address for the configured local web service. This does not require inbound router port forwarding, firewall changes, VPN setup, or a public IP address. Use the service only where your organization permits outbound tunneling and public application access.

Architecture illustration for remote chat access through a public endpoint and an outbound Localtonet connection.
The client device must be able to reach the selected local chat listener.

A public endpoint is a route, not a replacement for application configuration. The chat server may still advertise an internal hostname, reject the browser’s public origin, or generate an unusable real-time connection address. Creating the tunnel and configuring the application are distinct tasks, and both must pass verification.

💬 Application readiness Login, local messaging, and dependencies must work before public exposure.
🎯 Reachable local target Use the application or established reverse-proxy listener that the Localtonet device can actually reach.
🌐 Correct public identity Links, redirects, callbacks, and real-time connections must use the intended public hostname.
⏯️ Explicit lifecycle The endpoint depends on a connected client device and a running tunnel. Creating a configuration alone is insufficient.
Publication verification remains necessary

The available evidence establishes Localtonet’s general HTTP tunnel behavior, but does not include the current HTTP setup page’s complete numbered procedure, operating-system-specific client installation instructions, or a version-specific chat deployment guide. It also does not establish the final destinations of external documentation redirects or the availability and accuracy of the four retained image assets. Those checks must be completed before publication. The application integration below is a qualified configuration example, not a claim of a currently verified, version-pinned deployment.

Prerequisites and local checks

Choose a maintenance window and retain an administration path that does not depend on the new public address. A local console or authorized private-network connection is important because an incorrect public URL can break browser administration or identity-provider login.

Record the application version, deployment method, local listener, current public URL, existing reverse proxy, and configuration source. Configuration might come from a file, environment variables, a database, or a deployment management system. Editing a file that is overridden by the running service will not change the effective configuration.

Install and authenticate the Localtonet device

Install and run our client for the device’s operating system, then authenticate the device using its device-specific token. The selected device must be the machine that can reach the tunnel target. Keep the client running and confirm that the device is connected before relying on the public endpoint.

The supported general path is installation, client startup, device authentication, and selection of that device in the tunnel configuration. The supplied evidence does not establish a current Linux package name, download command, authentication prompt, service unit, or unattended-installation procedure. We therefore do not provide a guessed shell command or token flag. Complete the operating-system-specific installation using the current product instructions associated with the HTTP tunnel documentation.

Keep device tokens out of source control, screenshots, shared shell history, and ordinary operating notes. A token identifies the client device; it is not the chat application’s login password and should not be distributed to chat users.

Test the exact intended target

If the application and Localtonet client run directly on the same host, the target may be a loopback listener. The following is an illustrative check for an application listening on port 8065, not a port to assume for every deployment:

curl --connect-timeout 5 --max-time 15 \
  --silent --show-error --output /dev/null \
  --write-out 'HTTP %{http_code}\n' \
  http://127.0.0.1:8065/

A successful response proves only that an HTTP listener answered. A redirect may be intentional; a login page does not prove that the database, account login, or messaging works. Open the same address in a browser where possible, sign in with a test account, and exchange messages with a second session.

If our client runs on another machine, 127.0.0.1 refers to that client machine, not the chat host. Use the chat host’s reachable private address instead. A service bound exclusively to loopback cannot accept a connection from another LAN device.

Check containers and reverse proxies

For containers, identify the host-side published port. A container’s internal port is not automatically a host listener, and loopback inside one container is not the host’s loopback. Test from the same network environment in which the Localtonet client actually runs.

If the existing deployment uses a reverse proxy for routing, authentication, or application security controls, target that established entry point rather than bypassing it casually. Record every hop between the Localtonet client and the chat application. This makes forwarding-header and WebSocket failures much easier to diagnose.

Publish only the user-facing service

Do not target the database, message broker, container engine socket, private object-storage administration interface, or internal management listener. Reachability does not mean a component is intended for public access.

Chat compatibility depends on the deployment

Illustration comparing the application checks needed for Mattermost, Rocket.Chat, and Matrix deployments.
A similar tunnel path does not imply interchangeable public URL, discovery, or proxy configuration.

Mattermost and Rocket.Chat commonly expose browser interfaces and HTTP APIs, but their settings, deployment layouts, and real-time transports are application-specific. Matrix is a protocol ecosystem with multiple homeserver implementations. Its client access and federation requirements must be evaluated separately.

CapabilityPublic component to identifyRequired acceptance test
Browser chatApplication or established reverse-proxy HTTP listenerLogin, assets, API calls, and message exchange
Real-time messagingApplication’s WebSocket or persistent HTTP endpointLive updates, idle connection behavior, and reconnect
AttachmentsApplication download routes or separately configured public storageUpload, preview, and authenticated external download
Native clientsSupported server URL and discovery mechanismLogin, synchronization, uploads, and reconnection
Matrix federationHomeserver identity, discovery, and federation endpointsCommunication with an independent peer homeserver
Voice and videoSignaling and media components required by the selected platformTwo-way media between external networks
Illustration distinguishing HTTP tunnel routing from raw TCP forwarding for chat services.
Select transport from the documented listener requirements, not from the chat product’s name.

Our platform supports HTTP/s, TCP, UDP, combined UDP/TCP, and TLS tunnel families. That does not establish that an arbitrary media deployment will work after forwarding a few ports. Some media architectures require advertised addresses, separate relays, or multiple endpoints, and need their own deployment recipe.

For Matrix, do not change an established server identity simply to match a temporary tunnel hostname. Client discovery, server naming, media access, and federation require implementation-specific planning. This guide does not provide a Matrix federation or voice/video configuration.

Configure the HTTP tunnel

The steps below summarize the supported general Localtonet workflow. They are not represented as the exact numbered sequence of the current HTTP documentation, whose full contents were not supplied. Confirm the current HTTP form and ordering in the HTTP tunnel setup instructions before publishing a UI-specific walkthrough.

1

Install and run the client

Use the client for your operating system on a device that can reach the already tested local chat listener.

2

Authenticate and select the device

Use the device-specific token and select the connected device intended to carry this tunnel. Keep the token secret.

3

Select an available relay

Choose a server or region offered by the current product. Available values must come from the dashboard rather than a hardcoded example.

4

Create the HTTP configuration

Configure the tested local IP address and port. HTTP process types are Random Sub Domain, Custom Sub Domain, and Custom Domain, all serving the selected content at a public HTTPS address. Availability can vary. Check current DNS requirements before choosing a custom domain.

5

Start the tunnel

Press Start and use the assigned public HTTPS address. A saved configuration is not necessarily running, and the selected client device must remain connected.

Record the resulting HTTPS origin without placing device credentials in the record. For the examples below, https://chat.example.com is a placeholder. Replace it with the exact assigned address; do not configure the literal example hostname.

Endpoint testing belongs after setup. Stop and delete operations belong to maintenance and retirement, not to the tunnel-creation sequence. If configuring the application requires time, keep exposure limited to an approved test window and do not invite users until the acceptance checks pass.

Integrate the application with its public URL

A reproducible integration requires a specific application version and deployment method. The supplied research does not contain a version-specific primary deployment guide for any named chat server. It therefore cannot substantiate a currently verified Mattermost, Rocket.Chat, or Matrix recipe. In particular, a version mentioned in a third-party comparison is not sufficient evidence for its configuration semantics.

The following Mattermost example explains the configuration boundary concretely. It is applicable only after confirming that your installed release supports the named settings and that your deployment uses a file-based configuration with no overriding environment variables or database-managed settings. It should not be treated as a version-pinned production procedure.

Define a narrow integration target

Consider an already running, single-node Mattermost instance on a Linux host, with our client on that same host and a working local HTTP listener at 127.0.0.1:8065. The proposed scope is browser login, text messaging, and application-served attachments. Calls, federation, external storage, and identity-provider changes are excluded from the initial acceptance test.

Before changing anything, record the actual Mattermost version and configuration location. Preserve the existing configuration and its permissions. Do not replace the complete configuration with a short example, because doing so would discard database connections, secrets, and unrelated application settings.

Set the public URL in the authoritative configuration

In Mattermost configuration schemas that expose these settings, the relevant public URL field is ServiceSettings.SiteURL. A separate ServiceSettings.WebsocketURL field can specify a different WebSocket address. The intended same-origin arrangement is a public HTTPS site with its real-time endpoint on that same public hostname, rather than a URL containing localhost or a private IP.

This illustrative fragment shows the intended relationship, not a complete configuration file or a verified schema for the latest release:

{
  "ServiceSettings": {
    "SiteURL": "https://chat.example.com",
    "WebsocketURL": ""
  }
}

Leaving a separate WebSocket URL empty is appropriate only when the installed release derives the correct same-origin address. Confirm that behavior in the effective configuration and in the browser’s network panel. If an existing deployment uses an explicit WebSocket address, investigate why before changing it. Do not retain an internal ws:// address on an HTTPS browser page.

A public HTTPS URL does not require replacing a working local HTTP listener with the public hostname. These values serve different purposes: the local target tells our client where to connect, while the public URL tells the application what users should see.

Preserve the host, scheme, and real-time route

With an existing local reverse proxy, the proxy must route the ordinary application requests and the real-time endpoint to the same intended deployment. WebSocket upgrades require appropriate handling of the upgrade request, and long-lived connections must not be terminated by unsuitable proxy timeouts.

Exact proxy directives, forwarding headers emitted by Localtonet, and trusted-proxy settings are not established by the supplied evidence. We therefore do not prescribe an Nginx or Caddy block, a proxy-hop count, or a wildcard trust setting. Keep the existing known-good proxy configuration and verify the public path before altering trust behavior.

For a same-origin browser deployment, the browser page, API requests, and WebSocket request should use the intended public hostname. Do not enable wildcard cross-origin access as a workaround for a wrong site URL. If the browser reports an origin rejection, inspect the actual origin and the installed application’s effective configuration first.

Apply the change through the existing service manager

Configuration changes must reach the running process. Use the same supervisor or deployment system that currently starts the application. Do not launch a second chat process manually, and do not assume that saving a file automatically reloads it.

For a Linux installation already managed by systemd with a unit specifically named mattermost, the following conditional example restarts that existing service and checks its state:

sudo systemctl restart mattermost
sudo systemctl status mattermost --no-pager

These commands do not install a unit or establish that your deployment uses that name. For containers, apply changes through the existing container definition. Environment-variable changes generally require replacement of the affected container rather than merely restarting the old process. The exact service name and recreation command must come from that deployment’s configuration.

After restart, confirm the listener still answers locally and that the effective public URL is correct. A locally requested page may now redirect to the public hostname intentionally. Distinguish that expected redirect from a refusal, crash, or redirect loop.

Know what must be confirmed before production

A release-specific primary check must establish the installed version, authoritative configuration source, public URL behavior, real-time URL behavior, origin validation, proxy trust, and restart requirements. Without those checks, the example remains a test plan rather than a supported production recipe. Keep an unchanged recovery copy and do not broaden public access to compensate for an unresolved configuration error.

Verify the complete workflow

Test from the local listener outward, then test the application rather than only the landing page. Use ordinary test accounts and harmless content. Keep credentials and session cookies out of command output and shared diagnostics.

Check HTTP responses and redirects

From an external network, inspect the first public response without automatically following redirects:

curl --connect-timeout 5 --max-time 15 \
  --silent --show-error --dump-header - --output /dev/null \
  https://chat.example.com/

Replace the placeholder with your endpoint. Expect a valid HTTPS connection and an application response or intentional redirect. If a Location header appears, it should not expose a private address, container hostname, or obsolete domain. Do not use options that disable certificate validation to make a failed check appear successful.

Verify authentication and authorization

Use a phone on mobile data or another external connection. Confirm that scripts, styles, and images load without certificate or mixed-content errors. Sign in, sign out, and sign in again with an ordinary account. Check that private channels remain private and that the account cannot reach administrative functions.

Test invitations and password-reset links if configured. Identity-provider callbacks are a separate configuration dependency: both the application and provider must agree on the public callback address. Do not weaken callback validation to accommodate a wrong hostname.

Verify real-time messaging

Open two independent sessions, preferably on different networks. Send messages in both directions without refreshing either page. Test channel changes, direct messages, and presence or typing indicators where supported.

For a deployment using WebSockets, inspect the browser’s network panel. A conventional successful HTTP/1.1 WebSocket upgrade returns 101 Switching Protocols. Also verify ongoing frames and message delivery; a successful initial upgrade alone does not prove a stable connection. Watch for repeated reconnect attempts or requests to internal addresses.

Test interruptions, attachments, and clients

Temporarily disconnect an external test client, send a message from the other session, then reconnect. Confirm that the client resynchronizes according to the application’s normal behavior. Repeat after an idle period, since an unsuitable intermediate timeout may not appear during a short test.

Upload a harmless attachment, preview it, and download it from the second account. Confirm that generated links use a reachable public route and retain the expected authorization. Test the supported desktop and mobile clients separately, including notifications where configured.

During an approved maintenance window, stop and restart the tunnel and observe recovery. Record which functions passed, the installed application version, local target, public hostname, and test time. Do not describe untested federation or media as working.

Troubleshoot by connection layer

SymptomFirst checkSafe next action
Local connection refusedProcess state and listenerRestore the local application before changing tunnel settings.
Local connection times outTarget address and network reachabilityTest from the actual client device and review permitted LAN access.
Works only inside a containerHost-side port publishingUse the reachable published endpoint, not an assumed internal port.
Public endpoint unavailableClient connection and tunnel stateConfirm the host is awake, our client is running, and the tunnel is started.
Redirect to localhostEffective public URLCorrect the authoritative configuration and apply the change.
Repeated redirectsHost and scheme handling at each hopRemove conflicting rewrites without broadening proxy trust.
Page loads, live messages failReal-time request URL and responseCheck same-origin addressing and any existing proxy’s upgrade handling.
Sign-in fails after URL changeCallback registration and browser errorsRestore matching supported callback configuration.
Attachments failGenerated file URL and storage routeDetermine whether storage requires separate public configuration.

Change one layer at a time. If local requests fail, switching relays will not repair the application. If the local listener works but the device is disconnected, editing the application URL will not reconnect the tunnel. If only a custom hostname fails, compare its DNS configuration with current Localtonet requirements before altering the local target.

Use timestamps to correlate browser failures with application and existing proxy logs. Preserve response codes and error categories, but redact authorization headers, cookies, tokens, email addresses, and message content before sharing diagnostics.

Security, operations, and rollback

A public HTTPS endpoint is not a private membership boundary. Configure registration, invitation rules, account permissions, and authentication in the chat application. Use multifactor authentication or an identity provider where supported, remove development credentials, and keep administrator accounts separate from everyday messaging accounts.

Operate the complete dependency chain

Lifecycle illustration showing public tunnel availability depending on a connected client and running tunnel.
Monitor the local application and its public path, not just the existence of a saved tunnel.

Document which device runs Localtonet, what starts the chat process, and how dependencies recover after a host restart. Avoid inappropriate sleep settings for an always-needed service. Do not assume that a saved tunnel automatically becomes active after every restart; confirm device connectivity, tunnel state, and external message delivery.

Our platform-wide Token/Tunnel webhooks report Connected and Disconnected state changes for a selected Token Group. The request contains Id, ActionDate, Type, and Status. The Token/Tunnel webhook documentation describes this monitoring integration. Connection-state events complement, but do not replace, an application-level messaging test.

Maintain backups and software

Back up the database, uploaded files, configuration, and required secrets using the chat platform’s supported method. A database-only backup may omit attachments or encryption material. Protect backups from ordinary application accounts and test restoration in isolation.

Maintain the operating system, chat application, plugins, database, reverse proxy, and Localtonet client. After updates, repeat the local and external acceptance checks. Record version changes so a new failure can be correlated with an actual deployment change.

Roll back a failed publication change

  1. Stop the tunnel to end new public access through that endpoint while investigating.
  2. Use the retained local administration path to restore the previous application configuration, including public URL, explicit real-time URL, origin rules, and any proxy changes.
  3. Restore the previous authoritative environment or deployment definition if it overrides file settings.
  4. Restart or redeploy the application through its existing supervisor, then verify local login and two-session messaging.
  5. Restore any identity-provider callback changes made for the test. Do not leave obsolete callbacks enabled unnecessarily.
  6. Restart public access only after identifying the cause and repeating acceptance tests.

Configuration rollback is not permission to restore an old database blindly. Avoid combining this publication change with a database migration or application upgrade. If those changes are unavoidable, use the platform’s supported recovery procedure and account for messages written since the backup.

Retire access deliberately

Stop the tunnel when public access is no longer needed and delete obsolete configurations. For a retired or compromised device, revoke or replace affected device access through the supported account workflow. Rotate application credentials and sessions separately if they were also exposed. Removing a tunnel does not undo messages, invitations, or credentials already disclosed to someone else.

Frequently asked questions

Do I need a public IP address or router port forwarding?

No. Our client establishes an outbound connection to a Localtonet relay. The standard tunnel workflow does not require inbound router port forwarding, firewall changes, VPN setup, or a public IP address. Follow your organization’s network policies.

Should I target localhost or a LAN address?

Use loopback only when the Localtonet client can reach the service in that same host or network namespace. Otherwise use a reachable private address and appropriate listener. Test the exact endpoint from the client’s environment first.

Why does the login page work while messages do not update?

Ordinary HTTP requests may succeed while the real-time connection fails. Inspect its URL, origin, response, and reconnect behavior. Verify any existing reverse proxy’s handling of the application’s persistent connection.

Does Matrix client access automatically enable federation?

No. Server identity, discovery, federation endpoints, and peer communication require separate configuration and validation. A successful client login is not a federation test.

Will voice and video work through the same HTTP endpoint?

Not necessarily. Media can require separate services, advertised addresses, and transports. Validate the platform’s media architecture independently rather than exposing arbitrary ports.

Does creating a tunnel make it active immediately?

No. Start the tunnel explicitly. Public availability requires the selected device to remain connected and the tunnel to remain running.

Can I use a custom domain?

HTTP tunnels support Random Sub Domain, Custom Sub Domain, and Custom Domain process types. Check current availability and DNS requirements, then align application URLs and callbacks with the chosen hostname.

Is an HTTP tunnel a VPN or an account security system?

No. Standard tunnels provide connectivity to selected targets. VPN Manager is our separate private mesh VPN feature. Chat authentication, permissions, updates, and backups remain part of the application deployment.

Publish your verified chat endpoint with Localtonet

Start with a working local service, connect the device that can reach it, and validate public login and live messaging before inviting users. Keep application configuration, recovery access, and optional media requirements explicit.

Get Started Free →

Corrections & updates

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

Remove the outer article wrapper while preserving the existing hero, navigation, semantic sections, FAQ, and CTA. Provide one clearly scoped, version-identified worked integration for an already running chat server, using current primary documentation to explain its public URL setting, proxy and origin requirements, applicable real-time connection configuration, restart or reload procedure, expected verification results, and rollback. Explain the supported Localtonet client installation and authentication path for the chosen environme

Rebuild the body in the current lt-* structure: begin with the hero, move the existing overview figure into a relevant section, add an article-specific clickable guide card, assign matching IDs to every linked h2, remove the duplicated page title and outer article wrapper, add a proper FAQ h2, and retain one final CTA. Clarify the scope as exposing an already installed and locally verified chat server. Add prerequisites covering a working chat deployment, the exact reachable local IP and port, a Localtonet account and connected client

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