28 min read

How to Expose Local LLMs to the Internet Securely

Learn how to expose local LLMs to the internet securely for remote access, testing, and collaboration without complex network setup.

A remote client reaches a local Ollama API through a public endpoint, encrypted tunnel, and access-control layer.
Remote requests pass through a public endpoint and security boundary before reaching the local Ollama API.
AI ยท Local LLM APIs ยท Ollama ยท Localtonet ยท 2026

Publish a local inference endpoint without opening an inbound router port

A local model API normally listens only on the inference machine, which prevents remote applications from reaching it. In this tutorial, you will prepare and verify an Ollama API, place an authorization boundary in front of it when access is not strictly temporary, and publish the resulting local endpoint through a Localtonet HTTP tunnel. The Localtonet client establishes an outbound connection and provides a public HTTPS address without requiring inbound port forwarding, firewall changes, a VPN, or a public IP address. You will also learn how to test the complete request path, shut it down, diagnose common failures, and evaluate other local inference runtimes without relying on outdated ports or commands.

๐Ÿ”’ HTTPS transport and authorization explained separately ๐ŸŒ No inbound router port forwarding required โšก Local and remote verification included

What you are exposing and how the request path works

Ollama can run a model and provide a local HTTP API. On a typical installation, that API is available on the inference machine at http://127.0.0.1:11434. The loopback address is intentionally local: another computer on the internet cannot connect to it directly.

With Localtonet, the client application runs on the inference machine, or on another device that can reach the inference service. The client establishes an outbound connection to a selected Localtonet relay. An HTTP tunnel then maps a public HTTPS address to the configured local IP address and port. A remote request reaches the public address, travels through the active tunnel, and is delivered to the local target.

๐Ÿ’ป Local inference service Ollama loads the selected model and handles API requests on the machine that provides the CPU, GPU, and memory resources.
๐Ÿ›ก๏ธ Authorization boundary A separately authenticated application, API gateway, or reverse proxy should decide who may call the model when access is more than a brief controlled test.
๐Ÿ”— Localtonet client The selected device establishes the outbound relay connection. You do not need to configure inbound router port forwarding or obtain a public IP address.
๐ŸŒ Public HTTPS address An HTTP tunnel provides a public HTTPS URL. That protects the public HTTP transport, but HTTPS alone does not determine who is authorized to use the API.
A public URL is a public network endpoint

While the tunnel is running and the selected Localtonet client is connected, the assigned URL is reachable from the internet. A difficult-to-guess URL is not an access-control mechanism. If the local target does not authenticate callers, anyone who obtains or discovers the URL may be able to submit prompts, consume inference resources, inspect API metadata, or trigger supported model operations.

What local deployment does and does not guarantee

Local inference can reduce dependence on a hosted model provider and lets you choose where model execution occurs. It does not automatically provide complete privacy, zero cost, lower latency, unlimited capacity, or regulatory compliance. Hardware, electricity, administration, storage, and network connectivity still have costs. Performance depends on the model, quantization, context size, concurrency, hardware, and workload.

Data also does not remain entirely inside the inference machine once you expose the API. A remote prompt must travel from the caller to the public endpoint and back through the tunnel. The caller, any application placed in front of Ollama, logs, monitoring systems, and other components in the request path may process or retain data. Local deployment can support a privacy or data-residency program, but it does not establish compliance by itself.

Useful scenarios

A controlled public endpoint can help with mobile application testing, short-lived demonstrations, automation that must call an externally reachable URL, or access from a separate development device. A team may also use a centrally hosted model, but shared use requires stronger authentication, authorization, usage controls, logging decisions, and capacity planning than a personal test.

An LLM inference API is not the same thing as an AI agent endpoint or an MCP server. Ollama accepts model inference requests. An agent usually adds tools, workflow logic, memory, or application-specific permissions. Model Context Protocol defines interactions between MCP clients and MCP servers that expose tools or resources. If your actual objective is to publish a locally running McpNet Gateway, use the documented Localtonet MCP Gateway workflow instead of treating an Ollama inference API as an MCP server.

Prerequisites and decisions to make first

Complete the following checks before creating a public tunnel. Separating local runtime work from tunneling work makes failures much easier to diagnose.

Requirement Why it matters How to confirm it
Supported Ollama installation The local API must be running before Localtonet can forward requests to it. Install the current release for your operating system from the official Ollama download page.
A model available in Ollama API requests must name a model that exists on the inference machine. Use the current Ollama library and verify the installed name through /api/tags.
Sufficient local resources Model loading and context processing consume memory and compute capacity. Use the model publisher's current requirements and test the intended workload locally.
Localtonet client and account The client device establishes the outbound connection used by the tunnel. Install and run the current Localtonet client, then confirm the intended device is connected.
Authorization design HTTPS transport does not prevent unauthorized API calls. Choose a separately authenticated application, API gateway, or reverse proxy before sustained exposure.
Remote test device A local test cannot prove that the public route works. Use a separate network or remote system that has the intended credentials.

Choose a model based on current evidence

Model catalogs and tags change frequently, so this guide does not prescribe a volatile model ranking or an unverified memory minimum. Visit the current Ollama model library, review the model's license and publisher information, and choose a size suitable for your machine. Record the exact tag shown by Ollama because the API payload must use that installed name.

A smaller or more heavily quantized model often needs fewer resources, but model parameter count alone is not enough to predict memory use or performance. Context length, quantization, runtime overhead, concurrent requests, prompt size, and hardware acceleration all affect the result. Test the actual model and workload rather than relying on a generic RAM table.

Decide whether the endpoint is temporary or shared

For a brief test controlled by one operator, you can start the tunnel only for the test window, avoid sending sensitive content, verify one request, and stop it immediately. This limits exposure time but does not add authorization.

For team access, automation, or any recurring use, do not expose an unauthenticated Ollama API directly. Put an application or reverse proxy that validates credentials in front of Ollama, bind Ollama to loopback, and point Localtonet to the authenticated front end. The remainder of this guide identifies the two possible targets clearly.

Protect Localtonet device tokens

A Localtonet authentication token identifies a client device. Obtain it through the current authenticated product workflow, keep it out of screenshots and logs, and never paste it into an article, shared command, source repository, or support transcript. This guide intentionally does not show token-bearing service commands or place a token in shell arguments.

Install Ollama, acquire a model, and verify the local API

Terminal checks confirm that Ollama is running, a model is available, and the local API returns 200 OK.
Verify the Ollama service and local API before creating any public tunnel.

The commands in this section use Ollama's native API because it is the direct interface for the runtime. Ollama also documents compatibility endpoints, but compatibility is not necessarily identical to every behavior of a hosted API. Start with the native API so that runtime and tunnel problems are not confused with client-library compatibility problems.

1

Install the current Ollama release

Use the official Ollama download page and select the supported installer for your operating system. Installation methods and hardware support can change between releases, so use the instructions presented for the version you are installing rather than copying an old package command from a third-party tutorial.

2

Select and pull a current model tag

Choose an exact tag from the current Ollama library. Replace MODEL_NAME below with that tag. Do not include the angle brackets often used in documentation placeholders.

ollama pull MODEL_NAME
3

Run a local interactive test

Start the selected model and submit a harmless test prompt. The first use can take longer while the model is loaded.

ollama run MODEL_NAME
4

List models through the local API

In another terminal, request the local tags endpoint. A successful response is JSON containing the models available to this Ollama installation.

curl --fail-with-body http://127.0.0.1:11434/api/tags
5

Send a non-streaming local chat request

Replace MODEL_NAMEstream to false produces one JSON response, which is easier to inspect during setup.

curl --fail-with-body http://127.0.0.1:11434/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_NAME",
    "messages": [
      {
        "role": "user",
        "content": "Reply with the word ready."
      }
    ],
    "stream": false
  }'

Before continuing, confirm that the response identifies the requested model and contains an assistant message. The wording of generated text can vary, so validate the JSON structure rather than requiring an exact sentence. If this local request fails, do not create the tunnel yet. Resolve the runtime, model, or resource problem first.

Keep the local listener narrow

If Localtonet runs on the same machine as Ollama, target the loopback address and avoid changing the model server to listen on every network interface. A loopback listener reduces exposure on the local network. If the Localtonet client runs on another device, use a reachable private address and apply appropriate local network controls.

Build a security boundary before public exposure

A security boundary filters public HTTPS requests before they can reach the private Ollama API.
Authentication and traffic controls should sit between the public endpoint and Ollama.

Secure exposure requires more than creating a tunnel. Begin with a threat model: identify who should call the service, what data they may submit, which operations they need, how much compute they may consume, and what would happen if credentials or the URL leaked.

Principal risks

๐Ÿ”‘ Unauthorized use A caller may consume CPU, GPU, memory, and electricity or use the model for purposes the operator did not approve.
๐Ÿ“„ Prompt and response disclosure Sensitive prompts may appear in application logs, client histories, monitoring systems, traces, error reports, or retained conversations.
๐Ÿ“ˆ Resource exhaustion Large contexts, concurrent requests, repeated model loading, or long generations can exhaust memory and make the host unavailable.
๐Ÿงฉ Application-layer attacks If an agent, retrieval system, file tool, or administrative UI is exposed, prompt injection and ordinary web application risks may affect more than inference.
๐Ÿ—๏ธ Credential leakage API credentials can leak through source code, shell history, process arguments, browser storage, CI logs, or copied requests.
๐Ÿ–ฅ๏ธ Administrative exposure A management interface may permit model downloads, configuration changes, file access, or other actions that should never be publicly available.

Transport encryption is not authorization

A Localtonet HTTP tunnel provides a public HTTPS address. HTTPS protects HTTP traffic on the public connection against passive observation and tampering in that portion of the route. It does not prove that a caller is allowed to use the model. Authorization must be enforced by an application component that understands and validates the caller's credentials.

Localtonet authentication, SSO, and IP-restriction controls are not assumed in this tutorial because their current behavior is not established by the supplied product documentation. Instead, use a separately authenticated application, API gateway, or reverse proxy when the endpoint will be shared or kept available.

Recommended separation

Keep Ollama on 127.0.0.1:11434. Configure your chosen gateway or application to listen on another local loopback port, authenticate each request, and proxy only the required inference paths to Ollama. Then point Localtonet to the gateway port, not directly to port 11434.

Layer Responsibility Safe operating principle
Ollama Model loading and inference Keep it on loopback and expose only the API operations your application needs.
Authenticated application or gateway Identity, authorization, validation, and optional usage controls Deny requests without valid credentials and avoid forwarding administrative functionality.
Localtonet HTTP tunnel Public HTTPS address and forwarding to the selected local target Run it only while access is required and select the intended client device.
Remote client Stores credentials and submits requests Keep secrets outside source code and send only approved data.

Controls to implement where supported

  • Require endpoint-level authentication and reject missing, expired, or invalid credentials.
  • Grant each caller only the operations and models required for the workflow.
  • Restrict accepted methods and paths instead of forwarding an entire administrative interface.
  • Set request-body, context, output, concurrency, and timeout limits appropriate to your gateway and runtime.
  • Decide whether prompts and responses may be logged. Redact or disable sensitive logging where your software supports it.
  • Keep gateway credentials, Localtonet device tokens, and other secrets out of command-line arguments, repositories, screenshots, and client-side code.
  • Rotate credentials after suspected disclosure and review the gateway's access records if logging is enabled.
  • Stop the tunnel when remote access is no longer required.
Do not expose an unauthenticated administrative interface

A browser UI or runtime control panel may offer more capabilities than the inference endpoint your application needs. Publish a narrow authenticated API instead. If the chosen runtime combines administration and inference on one listener and cannot restrict paths, place a gateway in front of it or choose a deployment architecture that can enforce that separation.

Create and start the Localtonet HTTP tunnel

Localtonet console showing a connected HTTP tunnel to the Ollama API on port 11434.
The connected tunnel forwards its assigned HTTPS endpoint to the local Ollama port.

The tunnel target depends on your security design. For a short, controlled, non-sensitive test, the target can be Ollama at 127.0.0.1:11434. For recurring or shared access, the target should be the local port of your separately authenticated gateway.

HTTP and File Server tunnels support Random Sub Domain, Custom Sub Domain, and Custom Domain process types, and each serves content at a public HTTPS address. Availability can vary by plan or current product configuration. This tutorial uses a process type available in your dashboard and does not prescribe custom-domain DNS records because those requirements must be checked against current Localtonet documentation.

1

Install and run the Localtonet client

Install the current Localtonet application for the operating system on the device that can reach the chosen local target. Start the client and complete the current authenticated device setup. Do not share or print the device token.

2

Select the connected client device

In the Localtonet dashboard, select the device identified by its authentication token. Confirm that you selected the machine running Ollama or a machine that can reach the authenticated gateway.

3

Select an available relay server

Choose a server or region from the values currently offered in your dashboard. Available server codes and regions can change, so this guide does not hardcode one.

4

Create an HTTP tunnel for the local target

Open the Localtonet HTTP tunnel dashboard, choose the intended process type, and set the local IP address and port. Use 127.0.0.1 with port 11434 only for the controlled direct-Ollama test. For protected access, use 127.0.0.1 and the listening port of your authenticated gateway. Create the tunnel.

5

Start the tunnel and record its assigned URL

Creating a tunnel does not start it. Press Start, confirm that it is running, and copy the public HTTPS URL displayed by the product. Keep that URL private unless the intended audience needs it.

Availability has two dependencies

The endpoint works only while the selected Localtonet client or device is connected and the tunnel is running. Ollama or the authenticated gateway must also remain available on the configured local address and port. A saved tunnel configuration by itself does not make the model reachable.

Verify the public endpoint from a remote system

A remote system receives 200 OK after sending an authenticated request through the tunnel to Ollama.
Test from a separate network to confirm that the public endpoint reaches the local API.

Test from a device or network separate from the inference machine. A browser opened on the same machine is not a complete remote test. Replace PUBLIC_HTTPS_URL with the exact HTTPS URL displayed by Localtonet and replace MODEL_NAME with the exact installed model name.

Controlled direct-Ollama test

Use this only for a brief test that does not contain sensitive data. The following request confirms that the native tags route is reachable through the tunnel:

curl --fail-with-body "PUBLIC_HTTPS_URL/api/tags"

Then submit a small non-streaming chat request:

curl --fail-with-body "PUBLIC_HTTPS_URL/api/chat" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_NAME",
    "messages": [
      {
        "role": "user",
        "content": "Reply with the word ready."
      }
    ],
    "stream": false
  }'

A successful response should be valid JSON containing an assistant message. The first request can take longer if the model is not already loaded. After this controlled test, stop the tunnel unless you have implemented authorization.

Authenticated gateway test

The exact credential format is determined by your gateway, not by Ollama or the tunnel. For a gateway that explicitly validates a bearer token, a request may take this form:

curl --fail-with-body "PUBLIC_HTTPS_URL/api/chat" \
  -H "Authorization: Bearer YOUR_GATEWAY_CREDENTIAL" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MODEL_NAME",
    "messages": [
      {
        "role": "user",
        "content": "Reply with the word ready."
      }
    ],
    "stream": false
  }'

Replace the example header with the authentication scheme documented by your gateway. Store the real credential in an appropriate secret store or environment mechanism rather than committing it to source code. An arbitrary API-key string has no protective value unless a component in the request path validates it.

Test the negative path

A successful authorized request is only half of an authentication test. Repeat the request with no credential and then with an invalid credential. The gateway should reject both before the request reaches Ollama. If an unauthenticated request still produces a model response, the authorization boundary is not working.

Also test an allowed endpoint and a path that should not be exposed. A narrow gateway should forward the required inference routes and deny administrative or unrelated paths. Record expected response codes according to the gateway you selected rather than assuming every implementation uses the same error format.

Operate the endpoint safely and shut it down cleanly

A local model exposed for remote use is a small internet-facing service. Treat it as an operational system even when it runs on a workstation. The public route, local runtime, authorization layer, and host resources can fail independently.

Routine checks

  • Verify the local Ollama tags and chat endpoints before investigating the tunnel.
  • Confirm the authenticated gateway rejects missing and invalid credentials.
  • Confirm the selected Localtonet client remains connected.
  • Confirm the tunnel is running, not merely created.
  • Watch memory, compute utilization, storage, and request latency on the inference host.
  • Review gateway access records where logging is enabled and permitted by your data-handling policy.
  • Recheck model names after pulling, replacing, or removing models.
  • Retest authorization after gateway, runtime, or client upgrades.

Model and request lifecycle

Initial requests may be slower while a model loads. Larger prompts and contexts require additional processing and memory. Multiple simultaneous callers can increase queueing or trigger resource errors. Set realistic client timeouts and introduce concurrency or request limits in the authenticated application where supported.

Streaming responses also behave differently from a single JSON response. Use "stream": false during initial diagnosis. Once the basic route works, test streaming with the actual client and gateway because buffering and client timeout behavior can differ.

Shutdown sequence

1

Stop incoming application traffic

Ask active users to finish or stop submitting requests. For automated clients, pause the job or integration so it does not repeatedly retry during shutdown.

2

Stop the Localtonet tunnel

Press Stop for the tunnel in the dashboard. Verify that the public endpoint no longer reaches the local service.

3

Stop local components if they are no longer needed

Stop the authenticated gateway and Ollama according to their current operating-system and installation instructions. If the tunnel was only temporary, delete it when you do not intend to reuse the configuration.

4

Rotate credentials when appropriate

Rotate gateway credentials after a demonstration, suspected disclosure, or change in authorized users. If a Localtonet device token may have been exposed, replace it using the current account workflow.

Do not assume automatic restart behavior

This guide does not claim that the Localtonet client, tunnel, Ollama, or your gateway automatically restarts after a reboot. Startup behavior depends on the current client version, operating system, and installation method. Verify each component after maintenance instead of relying on invented service-mode commands.

How other local LLM runtimes fit this workflow

The networking pattern is not specific to Ollama. Any local HTTP inference server can be a tunnel target if the Localtonet client can reach its listener. However, ports, startup flags, API paths, authentication settings, model formats, hardware support, and user-interface navigation are runtime and version specific.

Do not assume that every local AI tool exposes the same OpenAI-compatible endpoints or accepts the same request fields. Even when a runtime advertises compatibility, model naming, streaming, tool calls, structured output, embeddings, error bodies, and authentication behavior can differ. Validate the runtime locally before creating a tunnel.

Runtime Deployment style What to verify in current primary documentation
Ollama Local application and API Installed model tag, local listener, native API route, compatibility requirements, and operating-system startup behavior.
LM Studio Desktop application backed by the LM Studio runtime How the current release enables its developer server, the configured port, supported API routes, model identifier, and authentication options.
LocalAI Self-hosted AI API platform Current installation image or package, backend configuration, published port, enabled endpoints, model setup, and API-key enforcement.
GPT4All Desktop-oriented local model ecosystem Whether the installed release includes an API server, how it is enabled, its configured address and port, and its supported request schema.
Jan Open-source desktop and self-hosted components Which Jan component provides the API, its current configuration, listener, authentication behavior, and model-provider requirements.
llama.cpp server Low-level local inference server The server binary name, build options, model format, current flags, configured listener, API routes, and hardware-specific parameters.
text-generation-webui Web interface with release-dependent API capabilities The current startup process, whether API support is enabled separately, actual UI and API listeners, extensions, and authentication controls.

Safe adaptation checklist

  1. Install the runtime from its current first-party distribution.
  2. Acquire a model using the runtime's documented model workflow.
  3. Start the intended API, not merely a browser chat interface.
  4. Identify the actual listening IP address and port from the running configuration.
  5. Call the intended API path locally with a documented payload.
  6. Place authentication and request controls in front of the runtime if they are not built in.
  7. Create and start a Localtonet HTTP tunnel targeting that protected listener.
  8. Repeat the same request remotely and verify unauthorized requests fail.

The current public pages for LM Studio and Jan describe evolving product lines, which is another reason not to copy old ports or menu paths into a new deployment. Consult the documentation bundled with or published for the exact release you install.

Troubleshooting an Ollama and Localtonet endpoint

Diagnose from the inside out: model, local Ollama API, authorization layer, Localtonet client, tunnel state, and remote request. This order prevents a public routing problem from hiding a simpler local failure.

The local server is unreachable

Run the local tags request again:

curl --fail-with-body http://127.0.0.1:11434/api/tags

If the connection is refused or times out, confirm Ollama is installed and running according to the current instructions for your operating system. Check whether the API was configured to use a different address or port. Localtonet cannot forward to a service that is not listening.

The tunnel targets the wrong address or port

Confirm that the tunnel target matches the component you tested locally. A direct temporary test normally targets 127.0.0.1:11434. A protected deployment must target the authenticated gateway's port instead. If Localtonet runs in a container, virtual machine, or different physical device, its 127.0.0.1 refers to that environment, not automatically to the Ollama host.

The Localtonet client is disconnected

The tunnel depends on the selected device being connected. Confirm that the Localtonet application is running on the intended machine, that the authenticated device is the one selected by the tunnel, and that the machine still has outbound connectivity. Do not solve this by opening an inbound router port.

The tunnel was created but never started

Creation and startup are separate lifecycle actions. Open the tunnel list and check its status. Press Start if it is stopped. If it stops again, first confirm the selected client is connected and the local target responds.

The model name is invalid

Query /api/tags locally and copy the exact model name into the request body. A catalog name, display name, or tag from another machine may not match what is installed. Pull the intended current tag if it is absent, then repeat the local request before testing remotely.

The API payload is malformed

Confirm that the request uses POST, includes Content-Type: application/json, contains valid JSON, names an installed model, and uses the fields expected by the selected Ollama endpoint. Shell quoting differs across operating systems, so test from a file or an API client if your shell alters quotation marks.

Authentication fails

Determine which component validates credentials. Localtonet forwarding does not make an arbitrary Authorization value valid. Check the authenticated gateway's current configuration, credential format, expiration, audience, and path rules. First test the gateway on its local port, then test through the public URL.

If requests succeed without credentials, stop the tunnel and correct the gateway routing. The protected tunnel must target the gateway, not a parallel route that reaches Ollama directly.

The request times out while loading the model

Submit a small local request and allow the model to load before repeating the remote test. Check host memory and compute utilization. A client, gateway, or automation platform may have a shorter timeout than Ollama needs for cold loading. Adjust only the component whose documented timeout is too short, and avoid masking persistent resource exhaustion with extremely long retries.

Context or resource errors appear

Reduce the prompt size, conversation history, requested output, or concurrency. Try a model appropriate for the available hardware. Model size is only one factor, so inspect the runtime's actual error and resource usage. Do not assume a tunnel problem when the HTTP request reaches Ollama and Ollama returns a model or memory error.

Local requests work but remote requests fail

  • Confirm the public URL is copied exactly and uses https://.
  • Confirm the selected Localtonet device is connected.
  • Confirm the tunnel is running.
  • Confirm the target matches the locally tested listener.
  • Test the same path and payload locally and remotely.
  • Check whether the gateway rejects the remote credential or path.
  • Use a simple non-streaming request before diagnosing streaming behavior.

Remote metadata works but chat generation fails

A successful tags response proves routing to Ollama, but it does not prove the requested model can load or generate. Check the exact model name, then run the same chat payload locally. Inspect runtime errors, available memory, model state, prompt size, and timeout behavior.

Responses are slow or unstable

Compare local and remote timing. If local generation is already slow, investigate model size, context, quantization, hardware, and concurrent workload. If only remote calls fail, inspect the gateway and client timeout behavior. Network exposure cannot make inference faster than the host can generate results.

Frequently asked questions

How do I expose Ollama through Localtonet?

Verify Ollama locally at 127.0.0.1:11434, install and connect the Localtonet client, select that device and an available relay server, create an HTTP tunnel for the local target, and then press Start. For anything beyond a brief controlled test, target a separately authenticated gateway in front of Ollama rather than exposing Ollama directly.

Does the public HTTPS URL authenticate users?

No. HTTPS protects HTTP transport on the public connection, but it does not decide whether a caller is authorized. Use an application, API gateway, or reverse proxy that validates credentials and forwards only approved API paths.

Is the endpoint available after I create the tunnel?

Not automatically. Creating and starting are separate actions. The endpoint is available only while the selected Localtonet client is connected, the tunnel is running, and the configured local target is responding.

Does running a model locally mean its data never leaves the machine?

Not when remote access is used. Prompts and responses travel between the remote client and the inference machine. Applications, gateways, client devices, logs, and monitoring components may also process data. Review the complete data path and logging policy before sending sensitive information.

Can any OpenAI-compatible client use an Ollama tunnel without changes?

Not necessarily. Compatibility can vary by endpoint, model naming, streaming behavior, tool support, structured output, and the client's API-key requirements. Verify the exact client against Ollama's current compatibility documentation and your authenticated gateway. An arbitrary API-key value provides no security unless a component validates it.

Should I expose a web interface or the inference API?

Expose the narrowest authenticated interface required by the workflow. Avoid publishing administrative interfaces that can change configuration, manage models, or access files. A purpose-built application endpoint is generally easier to authorize and constrain than a complete management UI.

Is an Ollama API an MCP server?

No. Ollama provides model inference APIs. MCP servers expose tools or resources using Model Context Protocol. If you are publishing a locally running McpNet Gateway, follow the separate Localtonet MCP Gateway workflow rather than substituting an Ollama API URL.

Do I need a static IP or router port forwarding?

No. The Localtonet client establishes an outbound connection to a relay, so this workflow does not require an inbound router port forward, firewall change, VPN setup, or public IP address.

How do I disable remote access immediately?

Stop the tunnel in the Localtonet dashboard. You can then stop the local gateway or Ollama if they are no longer needed. Delete the tunnel if you do not intend to reuse its configuration, and rotate credentials if they may have been disclosed.

Publish your authenticated local AI endpoint with Localtonet

Verify your model locally, place the right authorization boundary in front of it, and use a Localtonet HTTP tunnel to provide a public HTTPS address without inbound router port forwarding.

Get Started Free โ†’

Corrections & updates

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

Rebuild the body using the current Localtonet structure: a nonduplicative hero, an immediate clickable guide-navigation card, unique lowercase IDs on all primary h2 sections, semantic h3 subsections, approved lt-* components only, no inline styles, and one final CTA after the FAQ. Replace the malformed heading image and remove unsupported classes. Refocus the article on a fully verified Ollama-to-Localtonet HTTP tunnel tutorial with prerequisites, installation, model selection, local API verification, the documented Localtonet 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