Skip to main content
You can connect over SSH to a virtual machine (VM) that has no public IP address by using a tunnel in Nebius Tunnels. The VM stays isolated from the internet, and you don’t need a bastion host or a VPN to reach it. To establish the tunnel, the VM configuration includes a tunnel agent. The agent runs on the VM automatically after the VM starts. When you connect to the VM, the tunnel routes the traffic to the agent. Thus, only the IP address of the tunnel is exposed to the internet.
Use one VM per tunnel. Do not add several VMs to a single tunnel.

Costs

Nebius AI Cloud charges you for the following billing items: Nebius Tunnels is in preview and provided free of charge.

Steps

Create a tunnel

  1. In the web console, select the project where you want to create the infrastructure. All resources must be located in the same project.
  2. Go to  Networking → Tunnels.
  3. Click  Create tunnel.
  4. On the page that opens, set the tunnel name to my-tunnel.
  5. Click Create tunnel.

Prepare a service account

To authorize the VM in the tunnel, prepare a service account with the applicationtunnel.agent role. Later, you attach this service account to the VM.
  1. Create the service account:
    1. In the sidebar, go to  Administration → IAM.
    2. Click Create resource → Service account.
    3. In the window that opens, set the name to tunnel-agent-sa and select the project.
    4. Click Create and continue.
  2. Create a custom group in Identity and Access Management to assign the role to the service account:
    1. In the sidebar, go to  Administration → IAM.
    2. Click Create resource → Group.
    3. In the window that opens, set the group name to tunnel-agents. In the Scope field, select the project where you create all the resources.
    4. Click Create.
  3. Attach the tunnel and grant the applicationtunnel.agent role to this group. You can only grant this role by using the CLI.
    1. Get the group ID:
      The ID is specified in the items.metadata.id parameter in the output.
    2. Get the tunnel ID:
    3. Create an access permit in the custom group:
  4. Add the service account to the group:
    1. Go to  Administration → IAM.
    2. On the Groups tab, find and open the tunnel-agents group.
    3. Click  Add members.
    4. In the window that opens, open the Service accounts tab and add the tunnel-agent-sa service account.
    5. Once the account is added, close the window.
    Check the group page in general. Make sure that:
    • The tunnel-agent-sa service account is specified on the Members tab.
    • The tunnel and the applicationtunnel.agent role are specified on the Access permits tab.

Create a virtual machine

Prepare the VM configuration that includes the tunnel agent. Then, create the VM. The agent is deployed on the VM automatically.
If you need to change the VM configuration later, delete the VM and create a new one. A tunnel should be associated with only one VM, and you can’t change the cloud-init configuration of an existing VM.
  1. Generate an SSH key pair.
  2. Prepare the cloud-init configuration file. You’ll attach it to the VM. In this file, specify two parameters:
    • users.ssh_authorized_keys: Public SSH key.
    • write_files.content.tunnel_id: ID of the tunnel.
    This configuration enables the following actions:
    • Add a username and a public SSH key to the VM.
    • Deploy the tunnel agent.
    • Authenticate by using the service account attached to the VM.
    • Create the ssh Nebius Tunnels service. Use it to connect to the tunnel.
  3. Create the VM:
    1. In the sidebar, go to  Compute → Virtual machines.
    2. Click Create resource → Virtual machine. The creation flow is a step-by-step wizard. The sidebar shows your progress through the configuration sections. To move between sections, click Back and Next.
    3. On the Compute step, configure computing resources:
      1. In the Platform section, select:
        • Without GPUs
        • Regular
        • Non-GPU AMD Epyc Genoa
      2. In the Settings section, set:
        • Preset: 4 CPUs - 16 GiB RAM.
        • Project: The project where you create all resources for the tunnel.
        • VM name: tunnel-vm.
    4. On the Storage step, preserve the Ubuntu 24.04 LTS disk image and the SSD disk type, but change the disk size to 20 GiB.
    5. On the Network step, check the network and subnet. In the Public IP address field, select None.
    6. On the Configuration step, configure the access, identity and VM startup settings:
      1. In the Service account field, select the tunnel-agent-sa service account.
      2. In the Custom cloud-init config section, select Enable custom cloud-init config.
      3. In the field that appears, paste the contents of the ssh.yaml file prepared earlier.
    7. On the Review step, check the full VM configuration. To change a section quickly, click  next to the corresponding block. The wizard opens the relevant step with your current settings.
    8. Click Create VM.
Wait for the VM to start running.

Connect to the virtual machine

Connect to the VM through the ssh tunnel service:
In the VM address, specify:
  • tunnel_masked_ID: Mask of the tunnel ID without the applicationtunnel- prefix and regional routing code. Contains the last 15 characters of the tunnel ID. For example, for applicationtunnel-e00abcdef123456789, the masked ID of the tunnel is abcdef123456789.
  • region: Region of the project where you created the resources.
For more information about the tunnel URL, see Supported traffic. After the connection is established, the command line shows the prompt of the VM. The hostname of the VM matches its ID:
The VM can take a few minutes to become reachable after it starts running — it takes time to install the tunnel agent. If the connection fails, wait a few minutes and try again.

How to delete the created resources

The created VM and its boot disk are chargeable. If you don’t need them, delete the VM, so Nebius AI Cloud doesn’t charge for the resources. The boot disk is deleted automatically when you delete the VM. You can also delete free resources: