Running Jupyter Notebooks in Dataspell with Remote Kernels: A Practical Guide
Learn how to connect Dataspell to a remote Jupyter kernel over SSH to keep the IDE responsive while working with large data sets and complex visualizations.
02 Dec 2025, 03:57 UTC

Problem: Slow local notebooks when data grows
When a Jupyter notebook works with large data frames or intensive computations, the Dataspell process can become sluggish because all cells run in the local Python interpreter. Memory usage spikes, the IDE may freeze, and you lose the benefit of JetBrains’ smart editing features while waiting for execution.
Solution: Connect to a remote kernel via SSH
Dataspell lets you select any IPython‑compatible kernel that is reachable over SSH. By offloading execution to a remote machine with more resources, you keep the IDE responsive while still enjoying inline plots, variable inspection, and version‑control integration.
Worked example: plotting a DataFrame on a remote kernel
- Prepare the remote host: Ensure Python, Jupyter, and the required libraries (e.g.,
pandas,matplotlib) are installed. Verify that the SSH server allows password‑less login or that you have your key loaded in Dataspell’s SSH settings. - Add the remote kernel: In Dataspell, open Settings → Build, Execution, Deployment → Console → Jupyter. Click + to add a new kernel, choose SSH as the connection type, fill in host, username, and the path to the remote Python interpreter (e.g.,
/home/user/envs/ds/bin/python). Save. - Create or open a notebook:
File → New → Jupyter Notebookor clone a Git repo containing an.ipynbfile. - Select the kernel: In the notebook toolbar, click the kernel name and choose the SSH‑based kernel you just added.
- Run a cell: Enter the following code and execute with Shift+Enter:
import pandas as pd import matplotlib.pyplot as plt # Load a sample dataset (ensure the file exists on the remote host) df = pd.read_csv('/home/user/data/sales.csv') # Simple histogram of the 'amount' column df['amount'].plot(kind='hist', bins=30, edgecolor='black') plt.title('Sales Amount Distribution') plt.xlabel('Amount') plt.ylabel('Frequency') plt.show() - Verify the result: After execution, the plot should appear inline beneath the cell. Open the Variable Explorer pane (bottom‑left by default) and locate
df; its contents should match the printed output ofdf.head()if you run that in a separate cell.
Trade‑off and limitation
- Network latency: Each cell execution incurs an SSH round‑trip; very short cells may feel slower than running locally.
- Environment parity: The remote kernel must have the same package versions as your local development environment; mismatches can cause
ModuleNotFoundErroror differing plot styles. - File access: Paths in your notebook must refer to files accessible on the remote host; you may need to mount shared directories or copy data beforehand.
Actionable closing
Start with a small test notebook that loads a modest CSV and creates a simple plot. Monitor the Remote Hosts tool window for CPU and memory usage; if the remote stays comfortably under 70 % utilization while Dataspell remains responsive, you’ve successfully offloaded the workload. Gradually increase the notebook size and observe where the trade‑off shifts, adjusting the remote instance or using Dataspell’s built‑in Memory Viewer to stay within safe limits.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.