Skip to main content

Public Access to Services Inside Instances

On the GPUGEEK platform, this feature allows you to expose services inside an instance to the public internet. These services can be Web projects, API interfaces, Stable Diffusion web UI, ComfyUI, vLLM, or any process listening on HTTP or TCP ports.

Important Notes on Using This Feature

It is strictly prohibited to use this feature to provide pornographic, violent, illegal images, inappropriate text, or any behavior that violates national regulations or security rules. The GPUGEEK platform will monitor images, text, and network traffic in real-time. Once detected, the account will be immediately banned, and the platform reserves the right to pursue legal action and compensation for operational losses.

This feature can only be used after completing enterprise certification.

Below is a demonstration of the usage process for this feature


1. Complete Real-Name Authentication

Log in to the GPUGEEK console, click Account Center, and complete enterprise certification. After submission, the real-name verification will be approved within 0-3 working days.


2. Create an Instance

Refer to Create Instance for details on the instance creation process.


3. Create a Custom Port

Navigate to the instance console → find the corresponding instance → More → Create Custom Port (the instance must be running).


4. Add Custom Port Configuration

Click Add Port Configuration

Port Configuration

Enter the port your project listens on within the instance.

For example, if your process in the instance listens on port 8080, enter 8080 in the configuration. If it listens on 9000, enter 9000.

Each instance supports up to three exposed ports. Click Confirm once done.


5. Wait for the Port Reset to Complete


6. Click the Custom Port to Access

Click Custom Port 8080 or Custom Port 9000 to jump to the corresponding public-accessible URL. This address is the public port and address automatically assigned by the platform.

Mapping Relationship

In this example, clicking Custom Port 8080 redirects the browser to http://xxxxxxxx.gpugeek.com:60000/.

  1. Port 8080 is the port being listened to inside the instance.
  2. http://xxxxxxxx.gpugeek.com:60000/ is the public address and port automatically assigned by GPUGEEK.
  3. The 60000 port of domain xxxxxxxx.gpugeek.com is automatically bound and mapped to the instance’s 8080 port.
  4. You can access the service running on port 8080 of your instance via http://xxxxxxxx.gpugeek.com:60000.

7. Start the Service to be Exposed in the Instance

tip

The following defines a simple HTTP server with listening address 0.0.0.0 and port 9000. If your project needs to be accessed publicly, the listening address must be set to 0.0.0.0; otherwise, network forwarding will not work, and the service cannot be accessed via the public internet.

main.py
from http.server import BaseHTTPRequestHandler, HTTPServer

class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
self.wfile.write(b"Hello, This is a custom service provided by GPUGEEK !")

host = "0.0.0.0"
port = 9000

with HTTPServer((host, port), SimpleHTTPRequestHandler) as server:
print(f"Server started at http://{host}:{port}")
server.serve_forever()