Learn how to make your Pod services accessible from the internet using HTTP proxy and TCP port forwarding
Runpod provides flexible options for exposing your Pod services to the internet. This guide explains how to configure port exposure for different use cases and requirements.
When exposing services from your Pod, it’s important to understand that the publicly accessible port usually differs from your internal service port. This mapping ensures security and allows multiple Pods to coexist on the same infrastructure.
For example, if you run a web API inside your Pod on port 4000 like this:
The external port users connect to will be different, depending on your chosen exposure method.
Runpod’s HTTP proxy provides the easiest way to expose web services from your Pod. This method works well for REST APIs, web applications, and any HTTP-based service.
To configure HTTP ports during Pod deployment, click Edit Template and add a comma-separated list of ports to the Expose HTTP Ports (Max 10) field.
To configure HTTP ports for an existing Pod, navigate to the Pod page, expand your Pod, click the hamburger menu on the bottom-left, select Edit Pod, then add your port(s) to the Expose HTTP Ports (Max 10) field.
You can also configure HTTP ports for a Pod template in the My Templates section of the console.
Once your Pod is running and your service is active, access it using the proxy URL format:
Replace [POD_ID]
with your Pod’s unique identifier and [INTERNAL_PORT]
with your service’s internal port. For example:
abc123xyz
4000
https://abc123xyz-4000.proxy.runpod.net
The HTTP proxy route includes several intermediaries that affect connection behavior:
This architecture introduces important limitations:
524
error.Design your application with these constraints in mind. For long-running operations, consider:
For services requiring direct TCP connections, lower latency, or protocols other than HTTP, use TCP port exposure with public IP addresses.
In your Pod or template configuration, follow the same steps as for HTTP ports, but add ports to the Expose TCP Ports field. This enables direct TCP forwarding with a public IP address.
After your Pod starts, check the Connect menu to find your assigned public IP and external port mapping under Direct TCP Ports. For example:
Public IP addresses may change for Community Cloud Pods if your Pod is migrated or restarted, but they should remain stable for Secure Cloud Pods.
External port mappings change whenever your Pod resets.
Some applications require the external port to match the internal port. Runpod supports this through a special configuration syntax.
To request symmetrical mapping, specify port numbers above 70000 in your TCP configuration. These aren’t valid port numbers, but signal Runpod to allocate matching internal and external ports.
After Pod creation, check the Connect menu to see which symmetrical ports were assigned under Direct TCP Ports.
Your application can discover assigned ports through environment variables. For example, if you specify 70000
and 70001
in your Pod configuration, you could use the following commands to retrieve the assigned ports:
You can use these environment variables (e.g., RUNPOD_TCP_PORT_70000
) in your application configuration to automatically adapt to assigned ports.
When exposing ports from your Pods, follow these guidelines for security and reliability:
Different types of applications benefit from different exposure methods:
Try these fixes if you’re having issues with port exposure:
0.0.0.0
(all interfaces) not just localhost
or 127.0.0.1
.Once you’ve exposed your ports, consider: