Jupyter Notebook on your iPad with Junno Connect

Photo by Daniel Cañibano on Unsplash

Apps you need: Blink, Junno Connect

Open Blink and navigate to your ssh key

Click on “Keys” than on your first key which should be “id_rsa” and click on “Copy Public Key”.

Close the window and ssh into your server.

ssh user@your-server-address

Add your ssh-key into .ssh/allowed_keys

sudo nano ~/.ssh/authorized_keys

Install jupyter notebook on it

pip install notebook

Create a jupyter notebook config file with the command

jupyter notebook --generate-config

Now edit the created file called jupyter_notebook_config.py

nano -/.jupyter/jupyter_notebook_config.py

Search for the line called c.NotebookApp.allow_remote_access and change the value to True.

c.NotebookApp.allow_remote_access = True

To ensure a communication between your iPad and server can be established you have to open the port where your jupyter notebook will be hosted. On default the port number is 8888.

sudo ufw allow 8888

Verify your open ports

sudo ufw status verbose

As you might not want to always connect to your server and run a jupyter session, it is more pleasant to start a background session on your server with Tmux.

# start a new Tmux session tmux new -s jupytersession jupyter notebook --no-browser

Now press Ctrl + B to detach from this session and then press D. This will send your Jupyter notebook instance to the background, and keeps running even if you disconnect from your server.

However, if you want to stop your Jupyter instance, reconnect to your server and type the command:

tmux a -t jupytersession

Now all server side settings are done and we are ready to open Junno Connect.

On the left sidebar of the home screen click on “Add Jupyter Server..”, where you will facing the following screen:

Description: Just a random name for your connection

Type: We will go with “Local port forwarding” as we want to establish a SSH connection.

Address: your server ip-address which you also used before to ssh into your server

Port: default value with 22 should be fine.

Type: Private key

User: username of your server which you used before to ssh into your server

Now we will import your private ssh key into Junno Connect, therefore go back to Blink and ensure that you are not connected on any server. Than type the command

That will open a configuration window of Blink.

Click on “Keys” than on your first key which should be “id_rsa” and click on “Copy Private Key”.

Go back to Junno Connect and continue your settings by clicking on “Set private key” and click the button “Import from Clipboard”. Finish the ssh-key setup by clicking on the top right corner “Save”.

Host: localhost

Port: 8888

Click on “Save” on the top right corner to save your settings. Ensure that your jupyter notebook application is running on the server. If so, establish a connection on Junno Connect!

If everything went well, you will see the familiar jupyter home screen. Additional packages can be easily installed by the in-build terminal or just switch to your server and do an usual pip install.

Originally published at https://erwin-schleier.com on November 13, 2020.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store