How to run Google Colab Locally

Agus D Darmawan
2 min readMay 7, 2021

I just start using colab in daily replace the jupyter. To me, colab is more simple and easy to use. The feature the most interesting is floating running cell, add code cell and add text cell. We can add in jupyter anyway, but sometime i feel colab is better in visual.

screenshoot google colab’s feature

And another benefits is you can load instance in a cloud or local, of course our code sync the gdrive.

Running Google Colab, is a hosted jupyter notebook service and requiring zero setup. They also providing us with free access to compute resources ex GPU but not in Indonesia for now — -sad for me .

After overnight research i did this way to get more simple to use colab.

Step 1 : we need install pip install jupyterlab and pip install jupyter_http_over_ws as follow the instactions

click instruction from colab for details

As you can see, colab provide backend url to start locally. First you need to input the cmd prompt to the field

Token was generate automatically by jupyter notebook when we start it from command prompt

Step 2 : Install bat file as auto shortcut in our desktop

if you don’t install Anaconda, normally to start jupyter is from cmd and we start jupyter notebook. After read the documentation we can configure like these

jupyter notebook — notebook-dir=”C:/Users/Target Folder” — NotebookApp.token=”youcan_fillrandom_or_fromprevioustoken_and_googlecolabsave_sowedon’tneed_toreinput_everytime_weused" — NotebookApp.allow_origin=’https://colab.research.google.com' — port=3000 — NotebookApp.port_retries=0

That’s code, we can run in command prompt. But it will more be simple if we create the code as bat file like this

create file name with ext dot bat (*.bat) and paste previous code with STRAT at the beginning

START jupyter notebook — notebook-dir=”C:/Users/Target Folder” — NotebookApp.token=”youcan_fillrandom_or_fromprevioustoken_and_googlecolabsave_sowedon’tneed_toreinput_everytime_weused” — NotebookApp.allow_origin=’https://colab.research.google.com' — port=3000 — NotebookApp.port_retries=0

So, next time if you wan to running colabs locally, just double click the bat filename and click local instan in colabs without any reinput or replace the token again.

--

--

Agus D Darmawan

Data Manager at databoks.katadata.co.id and facing the world to numeric to simplify the life issues. Knowledge is nothing until you share it.