Skip to main content

What compute can I connect to using the Databricks SSH tunnel?

Summary

  • The Databricks SSH tunnel (Beta) connects to three kinds of compute: serverless compute, serverless GPU compute through AI Runtime, and classic clusters in dedicated (single-user) access mode.
  • Shared clusters aren't supported. A classic cluster must run Databricks Runtime 17.0 or above with Unity Catalog enabled, and any compute policy on it must not prohibit jobs execution.
  • Serverless and AI Runtime need no setup step: run databricks ssh connect, adding --accelerator for GPUs. Classic clusters use databricks ssh setup to create a reusable SSH host entry.
  • Admins gate access differently by compute type. Port forwarding to serverless compute controls serverless connections, while classic connections depend on who has dedicated compute assigned and CAN ATTACH TO permission.

What compute can I connect to using the Databricks SSH tunnel?

You can connect to Databricks serverless compute, to AI Runtime for serverless GPUs, and to classic compute that uses dedicated, single-user access. Shared clusters are not supported. Serverless is the simplest starting point because it needs no setup step; a dedicated cluster makes sense when your work depends on cluster libraries or a custom container. The SSH tunnel itself is in Beta.

Supported compute at a glance

Compute How to connect Requirements
Serverless compute databricks ssh connect, plus --ide vscode or --ide cursor to launch an editor Port forwarding to serverless compute enabled. No separate SSH setup step
AI Runtime (serverless GPU) databricks ssh connect --accelerator <accelerator>, which accepts GPU_1xA10 or GPU_8xH100 The AI Runtime feature enabled in the workspace
Classic dedicated, single-user cluster databricks ssh setup --name <connection-name>, then ssh <connection-name>; or databricks ssh connect --cluster <cluster-id> Databricks Runtime 17.0 or above, Unity Catalog enabled, and no compute policy that prohibits jobs execution
Shared clusters Not supported Not applicable

Every connection also needs Databricks CLI version 1.5.0 or above on your local machine, with authentication configured. If you omit --cluster, the tunnel connects to serverless compute.

How to choose between them

Question Points toward
Do you want nothing to provision and no setup step? Serverless compute
Do you need GPUs for interactive work? AI Runtime
Does your work depend on cluster libraries or a custom container image? A classic dedicated cluster
Are you running long jobs or multi-node training? databricks air or a job, not an SSH session
Does your workspace use the compliance security profile? Ask your admin, because serverless port forwarding is off by default there

How each compute type behaves

Serverless compute. There's nothing to provision. To pre-install Python dependencies, pass a workspace base environment with --base-environment. The docs support this with serverless environment version 4 or below, and the flag can't be combined with --cluster. To use Spark in a Python file, initialize a session explicitly:

from databricks.connect import DatabricksSession
spark = DatabricksSession.builder.serverless().profile("DEFAULT").getOrCreate()

AI Runtime. Adding --accelerator gives you an interactive session on a single node of serverless GPU compute. For long-running training jobs or multi-node distributed training, the docs recommend submitting the workload with databricks air.
Classic dedicated clusters. databricks ssh setup prompts you to pick a cluster, or takes --cluster <cluster-id>, and writes a host entry to your SSH configuration so your IDE's Remote-SSH menu can reuse it. The session's pythonEnv-xxx environment includes the built-in Databricks Runtime libraries and compute-scoped libraries, and cluster libraries persist across restarts. If you use Databricks Container Services, your image must have openssh-server installed. The CLI starts a stopped cluster when you connect unless you set --auto-start-cluster=false, which the docs recommend for IntelliJ users because JetBrains IDEs start all configured clusters on launch.

What admins control

  • Serverless. Port forwarding to serverless compute is on by default, except in workspaces with the compliance security profile. An account admin can turn it off for every workspace; otherwise each workspace admin decides. When it's off, the SSH tunnel stops working on serverless compute, while notebooks, jobs and Databricks Connect keep working.
  • Classic. That setting doesn't apply. A user can connect only to dedicated compute assigned to them, with CAN ATTACH TO permission or greater, and CAN RESTART if the cluster isn't running. To restrict access, limit who can use the Personal Compute policy and who holds the unrestricted cluster creation entitlement.

Limits to plan around

The docs allow a maximum of 10 SSH connections per cluster, warn that inactive sessions might drop after 1 hour, and note that multiple SSH sessions on the same cluster share one virtual environment. Files in /Workspace, /Volumes and /dbfs persist across restarts; local paths such as /home and /root don't.
See Connect to Databricks using an SSH tunnel, the databricks ssh command reference and Manage port forwarding to serverless compute.

FAQs

Can I connect the SSH tunnel to a shared cluster?

No. Classic connections require a dedicated, single-user cluster, and shared clusters aren't supported.

Do I need to run setup for serverless compute?

No. After installing and authenticating the Databricks CLI, run databricks ssh connect. The databricks ssh setup command only creates reusable host entries for classic dedicated compute.

Can I use GPUs through the SSH tunnel?

Yes, through AI Runtime. Once the AI Runtime feature is enabled, add --accelerator with a supported value such as GPU_1xA10.

Will my cluster start automatically when I connect?

Yes, by default. If startup takes longer than your IDE's connect timeout, the attempt fails, so raise remote.SSH.connectTimeout or start the cluster first.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.