Using Jupyter Lab as a Lightweight Remote Desktop
Using Jupyter Lab as a Lightweight Remote Desktop
Jupyter Lab isn't just for data science - it's a powerful all-in-one environment offering:
- Programming (Python, R, etc.)
- Shell Access
- File Browser & Editor
- Plugins
All within your browser, without heavy windowing systems or VNC, making it a great alternative to traditional remote desktops!
Setup Instructions
Server Side
First, install Conda and set up a Conda environment.
Install Jupyter Lab
1 | |
Install kernels for Jupyter Lab:
Python (IPyKernel):
1 | |
R (IRKernel):
1 | |
Launch Jupyter Lab and Make it accessible
Start a tmux session.
Start JupyterLab in it, listening on localhost:8888, with no password/token:
1 | |
Then open another tmux pane, set up push-pull-port, and push port 8888 to port $PRIVATE_PORT (localhost only) of remote public server $PUBLIC_HOST:
1 | |
Then detach from the tmux session.
Client Side
Set up push-pull-port.
Pull the remote port and forward it to your local 8888 port:
1 | |
Access in Browser: Open http://localhost:8888/lab.
Exporting Jupyter Notebooks
You can export a Jupyter Notebook to a Python script or Markdown file by using nbconvert to convert notebooks:
Export to Python
1 | |
Export to Markdown
1 | |
This will create your_notebook.py or your_notebook.md in the current directory.