Share your local Jupyter Notebook on Internet for Free
Tags: datascience, machinelearning, jupyter, productivity
Published: 2020-07-11 13:00:11

During this global lockdown, it's interesting to observe an upsurge in learning *python* and in particular *machine learning*. There are innumerable free online resources and teachers from where or whom you can learn, but all use a common open-source software (or its clone) - **Jupyter Notebooks**. It's one of the most useful tools for all ranks of data scientists/engineers/analysts.

While teaching online, the teachers either prerecord the sessions or consider taking sessions live. During live sessions most of the teachers use one of several video conferencing platforms, coding on their local machine (or ready-to-run notebooks) and share it live. This has two serious demerits - 
1. Internet penetration is still worse for many developing countries. So viewing code onscreen or receiving a clear audio is a still a distant dream for many.
2. If students want to just run few lines of code or check their doubts regarding the code shared onscreen during sessions, they have no option to copy. It has to be either shared by the teacher before the session or the teacher has to pause for extra few minutes on each code blocks. 

Being a teaching assistant myself for several data science courses, I have noticed few good and enthusiastic teachers discussing on the lack of free video conferencing with live code sharing platforms. There isn't any! 

Well, for now, an audio conference with live code sharing shall suffice.

For live code sharing, one solution is very obvious - **Google Colab Notebooks**. It's the best resource built for data science EVER!

![Kind of solved](https://dev-to-uploads.s3.amazonaws.com/i/8dx8642v8p0opswffly3.gif)


**In this article** I shall provide you an alternate free option for live code sharing, which might help you. At the least, it's a good feature to know.

You can share your local Jupyter notebooks live with a small group while hosting a session.

###Prerequisite:
 You already have [Jupyter notebooks](https://jupyter.org/install) installed locally.

###Requirements:
* Download [ngrok](https://ngrok.com/download) locally.
* Follow all the steps mentioned till step 3.

##Steps:
* Before firing up the ngrok or a Jupyter notebook, run

![Step 1](https://dev-to-uploads.s3.amazonaws.com/i/ah2gndpapnbelep3v3hw.png)

* Copy the address mentioned after `Writing default config to:`

![Step 2](https://dev-to-uploads.s3.amazonaws.com/i/ruv22ehv573nwswwugdp.png)

* Then run the code below, replacing your address (from the step above) instead of mine.

![Step 3](https://dev-to-uploads.s3.amazonaws.com/i/eudhwfbspx58g7nwojpv.png)

* For a secured session, set the password for your Jupyter Notebook by running

![Step 4](https://dev-to-uploads.s3.amazonaws.com/i/nz7elmirigotvb66t8i4.png)

* Fire up your Jupyter notebook and keep a note of the port

![Step 5](https://dev-to-uploads.s3.amazonaws.com/i/qp1ie77173vboiv9pvdz.png)

* Open a new tab in your terminal and fire up ngrok on your port

![Step 6](https://dev-to-uploads.s3.amazonaws.com/i/l7zggqstyqmjf332gma8.png)

Your terminal would show something similar to

![Output](https://dev-to-uploads.s3.amazonaws.com/i/ots8vk7hxamvhsm6xb8f.png)

Copy the HTTP link with ngrok.io at the end and share it with your group with the notebook password. You get an 8-hour session.
Each time you write a new line/block of code in your notebook press Ctrl+S (Linux/Windows) or Cmd+S (macOS) to share the updated notebook. The group members have to refresh on their end to see those changes. 

*Note: As a host if you receive an alert like this*

![Alert](https://dev-to-uploads.s3.amazonaws.com/i/5k15t6gi8v02l7gfg1nf.png)

Just click `Overwrite` so that whatever changes you make during the session remains intact for that session.

That's how you share your code session live with a group for free while working on your local machine and simultaneously allowing your group to code on the notebook during the session and eventually letting them download the session notebook.

Thanks to **Project Jupyter** and **ngrok**. 

Let me know if you have any better idea.