Skip to main content
To connect a service to a tunnel, configure and run a tunnel agent. You’ll need the tunnel ID in the agent configuration.

Prerequisites

  1. Install and configure the Nebius AI Cloud CLI.
  2. Get the project ID and the tenant ID, and save them to environment variables:
  3. Get the tunnel ID by listing tunnels in your project:
    The command uses the project ID from your CLI profile configuration. Copy the ID of the tunnel that you want to connect to and save it to an environment variable:

Connecting a service

  1. Install Docker Engine.
  2. Create a service account and save its ID:
    To grant wider access instead of creating a dedicated group with the applicationtunnel.agent role, you can add the service account to the editors group.
  3. Create a group for Nebius Tunnels service accounts and save its ID:
  4. Grant the group the applicationtunnel.agent role for the tunnel:
    To grant access to more tunnels, create the permit on a broader resource: a project or a tenant. A permit on a project applies to all tunnels in that project. A permit on a tenant applies to all tunnels in all projects in the tenant.
  5. Add the service account to the group:
  6. Create a key pair:
  7. Upload the public key and save its ID:
  8. Create config.yaml for the agent:
    In the agent configuration, services.name can contain up to 20 characters and must use only lowercase Latin letters and digits ([a-z0-9]). Don’t use dashes or dots. For multiple services, configure the services section like this:
  9. Run the agent using a cross-platform Docker image:
    When the agent connects, it returns the public endpoint for each service. The endpoint format is:
    Where:
    • service_name is the services.name value from the agent configuration.
    • tunnel_masked_ID is the mask of the tunnel ID without the applicationtunnel- prefix and regional routing code. For example, for applicationtunnel-<routing_code>abcdef1234, the tunnel ID mask is abcdef1234.
    • region is the region of the project where the tunnel was created, for example eu-north1.