Skip to main content
In this guide, you’ll create a tunnel, prepare access for a tunnel agent, connect to a Compute virtual machine (VM) and run the agent on the VM. After the agent connects, your local service on the VM will be available through a public tunnel URL.

Costs

Nebius Tunnels is provided free of charge during preview. If you create a VM for this guide, Nebius AI Cloud charges you for Compute resources.

Prerequisites

  1. Install and configure the Nebius AI Cloud CLI.
  2. Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
  3. Create a Compute VM or select an existing one.
  4. Set up SSH access to the VM and make sure that a local HTTP service is available on the VM, for example at localhost:8080.
  5. Get the project ID and save it to an environment variable:
  6. Get the tenant ID and save it to an environment variable:
    You’ll need the tenant ID when granting the service account access to Nebius Tunnels.

Steps

Create a tunnel

Create a tunnel and save its ID:

Prepare agent access

  1. Create a service account for the tunnel agent and save its ID:
  2. Create a group for Nebius Tunnels service accounts and save its ID:
  3. Grant the group the applicationtunnel.agent role for the tunnel:
  4. Add the service account to the group:
  5. Create an authorized key pair:
  6. Upload the public key and save its ID:

Connect to the VM

Use the SSH access method that you configured for the VM. The VM doesn’t need a public IP address for Nebius Tunnels, but your SSH client must be able to reach it, for example, by using a public IP address, a private IP address or an FQDN from another VM in the same network. For more information, see How to connect to virtual machines in Nebius AI Cloud.
  1. Copy the service account private key to the VM:
  2. Connect to the VM:

Run the tunnel agent

Run the following commands on the VM.
  1. Download and extract the nebius-tunnel-agent binary for your VM’s OS and architecture. Available archives: For example, to download and extract the Linux x86_64 archive:
  2. Create config.yaml for the agent:
    In the configuration, specify the following values:
    • tunnel_ID: Value of $TUNNEL_ID.
    • service_account_ID: Value of $SA_ID.
    • authorized_key_ID: Value of $PUBLIC_KEY_ID.
  3. Run the agent:
    When the agent connects, it returns the public endpoint in the following format:
    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.
  4. Add the https scheme and open the returned endpoint in your browser.

How to delete the created resources

If you don’t need the tunnel, delete it:
If you created a VM for this guide and don’t need it anymore, delete the VM, so Nebius AI Cloud doesn’t charge for it.