-
Notifications
You must be signed in to change notification settings - Fork 3
Setting up JupyterLab in Docker
Now, open Terminal (Mac) or Command Prompt (Windows) by searching for it by name on your computer. On Mac, the search icon is located at the top right of the screen and on Windows, the search icon is located at the bottom left. Windows users can also hit the Windows key and type cmd.
If you are a Windows user, you will want to make sure Docker has actually started. To do this. Hit the small up arrow next to where your Wifi and volume icons are located. Hover over the small whale icon for Docker, and if it is running, it will say “Docker is running”. If it says anything else, hit the Windows key or hit the Windows icon in the bottom-left of your screen and type Docker. Then select Docker or Docker Desktop. This will start up Docker.
Once it has opened, type docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes jupyter/datascience-notebook and hit enter. It should look like this:
Executing the command: jupyter lab
[I 18:24:51.655 LabApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 18:24:52.085 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.8/site-packages/jupyterlab
[I 18:24:52.085 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 18:24:52.088 LabApp] Serving notebooks from local directory: /home/jovyan
[I 18:24:52.088 LabApp] The Jupyter Notebook is running at:
[I 18:24:52.088 LabApp] http://6dd98c082d46:8888/?token=c44f4c68e95e6e5d77489cd3dab5bfa875f3d8848a446e23
[I 18:24:52.088 LabApp] or http://127.0.0.1:8888/?token=c44f4c68e95e6e5d77489cd3dab5bfa875f3d8848a446e23
[I 18:24:52.088 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:24:52.091 LabApp]
To access the notebook, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
Or copy and paste one of these URLs:
http://6dd98c082d46:8888/?token=c44f4c68e95e6e5d77489cd3dab5bfa875f3d8848a446e23
or http://127.0.0.1:8888/?token=c44f4c68e95e6e5d77489cd3dab5bfa875f3d8848a446e23
Next, open your browser and in the search bar, type “http://localhost:8888/?token=”, and then copy the token generated and paste it. The token is the 30-character long series of numbers and letters as seen in the link below. Alternatively, you can copy the last link directly from your terminal ( in this case, http://127.0.0.1:8888/?token=c44f4c68e95e6e5d77489cd3dab5bfa875f3d8848a446e23 ) and paste it into the browser. Do not copy the above link! Rather, copy the link that is in your terminal.
Windows users can copy and paste the token code directly from the command line into the address bar if you wish by dragging and copying with Ctrl+C.
You should now see a Jupyter home page.