Expose ports

Expose ports

When you want to expose a port from your notebook instance to the public internet, it's important to understand that the internal port you use in your container will likely not match the public-facing port. Let’s walk through an example to explain this.  

Suppose you want to run a public API using Uvicorn. You can launch your app with this command:
  1. uvicorn main:app --host 0.0.0.0 --port 8000
This tells Uvicorn to listen on all available network interfaces using port 8000.
However, to make this service accessible from outside your notebook instance, you’ll need to expose this internal port to the public using an external method. This typically involves forwarding or mapping the internal port to a public port, which might be different. Let's now expose this port to the public internet using our method.

Exposing Ports via GreenNode’s Proxy

Let’s say you want to expose port 8000. The key step is to configure this port when creating your notebook instance. Head over to the Notebook Instance creation page and locate the HTTP Ports section. There, simply add 8000 to the list of allowed ports.

Once your notebook is running, GreenNode’s proxy will automatically handle the mapping between the internal port and a public URL. This allows you to access your application (running on port 8000 inside the instance) directly from your browser via the provided GreenNode URL.
The proxy URL follows a predictable pattern based on your instance’s unique ID and the internal port you exposed:
  1. https://{INSTANCE_ID}-{INTERNAL_PORT}-sea1.notebook.console.greennode.ai/ 
This method is especially useful when you're running web services like APIs, dashboards, or custom UIs from your notebook instance.

Exposing Ports via TCP Public IP

Another method for making your API accessible is to expose it through a public TCP IP. To enable this, add the desired port (e.g., 8000) to the TCP configuration section. This setup tells the platform to expose the port not through a proxy URL, but via a direct IP address and port combination.


Once configured, you’ll be provided with:
  1. A public IP address  
  2. A mapped external port  
Your connect menu may display something like this:

In that case, if your application is running on internal port 8000, you can access it publicly using:




    • Related Articles

    • Import a model registry with custom container

      The model registry is a centralized repository for storing trained models, their metadata, versions, and associated artifacts. It allows for version control, management, and organization of models developed during the training phase. This enables ...