What is the best way to work with Databricks from my IDE?
Summary
- The best way depends on where you want your code to run. For people writing code, Databricks documents three main IDE paths: the SSH tunnel, the Databricks IDE extension and Databricks Connect.
- For Python data and ML work that should run in the same environment as your cluster or serverless compute, the SSH tunnel (Beta) moves Python, the kernel and execution onto Databricks compute.
- For Spark code you want to debug locally, Databricks Connect runs general code on your machine and DataFrame operations on Databricks, from any IDE.
- For deploying jobs and pipelines as code, the Databricks IDE extension for Visual Studio Code and Cursor runs Declarative Automation Bundles from the editor.
- Don't combine the SSH tunnel and the IDE extension: the docs say they "are not compatible and should not be used together".
What is the best way to work with Databricks from my IDE?
Choose by where you want the code to run. If you want your editor to behave as if it were inside the workspace, with the same Python environment, libraries and files, connect it to Databricks compute with the SSH tunnel. It's the path Databricks built for IDE-driven data engineering, data science and ML, though it's still in Beta. If you write Spark code and want to step through your own logic locally, use Databricks Connect. If your goal is shipping jobs and pipelines through CI/CD, use the Databricks IDE extension with Declarative Automation Bundles.
Your IDE options at a glance
| Tool | Where code runs | Best for |
|---|---|---|
| SSH tunnel (Beta) | Everything on Databricks serverless compute, AI Runtime or a dedicated cluster | Full remote development in your cluster's environment |
| Databricks Connect | General code locally; DataFrame operations on Databricks compute | Debugging Spark applications from any IDE or app |
| Databricks IDE extension | Databricks compute, or Lakeflow Jobs | Bundles, running files and notebooks, CI/CD patterns |
| Databricks Sandbox (Beta) | Isolated lightweight serverless compute | Coding agents and untrusted code |
How to choose an IDE workflow
Ask these questions in order:
- Does non-Spark code need Databricks compute? Data loading, model training and plain Python all run remotely in the SSH tunnel. With Databricks Connect, only Spark work and UDFs go to Databricks; the rest runs on your laptop.
- Where should dependencies live? In the tunnel, your environment is the cluster's or the serverless environment's. With Databricks Connect, you install application dependencies locally and UDF dependencies on Databricks.
- Are you deploying or exploring? Bundles turn jobs and pipelines into versioned source files. That's the extension's strength.
- Which editor? The tunnel officially supports Visual Studio Code and Cursor and documents IntelliJ IDEs. PyCharm has a Databricks plugin. For other IDEs, the docs recommend the Databricks CLI with Databricks Connect.
How Databricks approaches IDE development
The SSH tunnel. The SSH tunnel docs describe it as moving "your entire development environment onto the compute." It needs Databricks CLI 1.5.0 or above. Serverless takes one command, and a dedicated classic cluster gets a reusable host entry:
# Serverless: open Visual Studio Code (or use --ide cursor)
databricks ssh connect --ide vscode
# Dedicated, single-user cluster
databricks ssh setup --name my-cluster --cluster <cluster-id>
ssh my-cluster
After connecting, open /Workspace/Users/<your-username>, then pick the pythonEnv-xxx interpreter or notebook kernel. .ipynb notebooks get Databricks globals such as spark, dbutils and display, plus the %sql magic. Keep files in /Workspace, /Volumes or /dbfs, because local paths are lost on restart. Classic clusters need Databricks Runtime 17.0 or above and Unity Catalog, and shared clusters aren't supported. Serverless needs port forwarding to serverless compute, which is on by default except in workspaces with the compliance security profile.
Databricks Connect. Databricks Connect is a client library built on open-source Spark Connect, for Python, R and Scala. The docs say it "enables developers to develop and debug their code on Databricks compute using any IDE's native running and debugging functionality." The serverless tutorial is short:
from databricks.connect import DatabricksSession
spark = DatabricksSession.builder.serverless().profile("<profile-name>").getOrCreate()
df = spark.read.table("samples.nyctaxi.trips")
df.show(5)
The Databricks IDE extension. The extension connects Visual Studio Code or Cursor to a workspace. It defines, deploys and runs Declarative Automation Bundles for Lakeflow Jobs and Spark Declarative Pipelines, runs local Python files on Databricks compute, runs files and notebooks as jobs, and debugs notebook cells through Databricks Connect.
One rule cuts across all three: the docs say the SSH tunnel and the IDE extension "are not compatible and should not be used together." Pick one per session. The IDE comparison page keeps the current matrix, and the launch blog explains why the tunnel exists: running non-Spark workloads remotely and keeping dependencies in sync used to be the gaps.
FAQs
Is the Databricks SSH tunnel generally available?
No. The SSH tunnel is in Beta, and the docs say cost and pricing for Beta features are subject to change. Databricks Connect and the IDE extension carry no Beta label in the docs.
Do I need a running cluster to develop from my IDE?
No. databricks ssh connect connects to serverless compute when you don't pass --cluster, and Databricks Connect can target serverless with DatabricksSession.builder.serverless().
Can I debug code line by line?
Yes. With Databricks Connect you use your IDE's own debugger, and the Spark work runs on Databricks. In the SSH tunnel, you run and debug Python files and .ipynb notebooks with the standard Python and Jupyter extensions, all on remote compute.
Should a coding agent use the SSH tunnel?
The SSH tunnel docs call it a tool "for IDE-driven development" and point coding agents that need a lightweight, sandboxed environment to Databricks Sandbox.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.