> For the complete documentation index, see [llms.txt](https://stephanosterburg.gitbook.io/scrapbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stephanosterburg.gitbook.io/scrapbook/data-science/fast.ai/how-to-work-with-jupyter-notebook-on-a-remote-machine-linux.md).

# How to work with Jupyter Notebook on a remote machine (Linux)

I typically use my computers at home to connect to my work computer. I setup xRDP to remote desktop into my work computer(Linux) which is OK but slow at times depending on the Internet connection. Since I usually use jypyter notebook, I wanted to be able to run a jupyter notebook server on my work computer and access it from my home computer browser. I did some search on the Internet and found a method that works, thought I’d share it here.

1 - Open an SSH tunnel that forwards the port setup for Jupyter Notebook on the remote machine to a port on the local machine so that we can access it using our local browser

```
hamid@local_host$ ssh user@remote_host

user@remote_host$ jupyter notebook --no-browser --port=8889
```

This runs a jupyter notebook server on the remote machine on port:8889 without opening a browser since we will use the browser on our local machine to connect to this.

2- In a new terminal window on your local machine, SSH into the remote machine again using the following options to setup port forwarding.

```
hamid@local_host$ ssh -N -L localhost:8888:localhost:8889 user@remote_host
```

-N options tells SSH that no commands will be run and it’s useful for port forwarding, and -L lists the port forwarding configuration that we setup.

3- Access the remote jupyter server via your local browser. Open your browser and go to:

```
localhost:8888
```

To close the SSH tunnel simply do ctrl-c.
