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
- Install and configure the Nebius AI Cloud CLI.
-
Check that your project ID is saved in the Nebius AI Cloud CLI profile configuration:
- Create a Compute VM or select an existing one.
-
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. -
Get the project ID and save it to an environment variable:
-
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
-
Create a service account for the tunnel agent and save its ID:
-
Create a group for Nebius Tunnels service accounts and save its ID:
-
Grant the group the
applicationtunnel.agentrole for the tunnel: -
Add the service account to the group:
-
Create an authorized key pair:
-
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.-
Copy the service account private key to the VM:
-
Connect to the VM:
Run the tunnel agent
Run the following commands on the VM.-
Download and extract the
nebius-tunnel-agentbinary for your VM’s OS and architecture. Available archives: For example, to download and extract the Linux x86_64 archive: -
Create
config.yamlfor 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.
-
Run the agent:
When the agent connects, it returns the public endpoint in the following format:Where:
service_nameis theservices.namevalue from the agent configuration.tunnel_masked_IDis the mask of the tunnel ID without theapplicationtunnel-prefix and regional routing code. For example, forapplicationtunnel-<routing_code>abcdef1234, the tunnel ID mask isabcdef1234.regionis the region of the project where the tunnel was created, for exampleeu-north1.
-
Add the
httpsscheme and open the returned endpoint in your browser.