Qiita has already mentioned how to set a password for Jupyter, but I wish it was simply written as "There is no doubt if you do it this way. It's easy and secure." I hope it will be helpful for those who set up a Jupyter Notebook server from scratch.
For the time being, from the installation of Jupyter server.
$ pip install jupyter $ jupyter notebook --port=8888 #If you want to specify the port
$ pip install jupyterlab $ jupyter labextension install jupyterlab-plotly #When using Plotly with Jupyter Lab (details will be described later) $ jupyter lab --port=8888 #If you want to specify the port
You don't have to hash it yourself or write the password in clear text, it will be automatically encrypted and saved by keyboard input. It's easy. See also: Official Documentation
$ jupyter notebook password Enter password: Verify password: [NotebookPasswordApp] Wrote hashed password to $HOME/.jupyter/jupyter_notebook_config.json
If you don't want to launch the browser when the server starts, you can edit this file directly. The method is common to Jupyter Notebook / Lab.
$ jupyter notebook --generate-config Writing default config to: $HOME/.jupyter/jupyter_notebook_config.py #actually$HOME is not displayed. The home directory of your environment is displayed.
When I try to draw a Plotly graph in Jupyter Lab, it may not be displayed. Let's install the plugin with the
jupyter command. It is assumed that the
node command can be used globally.
Install as described in * JupyterLab Support (Python 3.5+) * in Plotly Official Documentation.
$ brew install node #For macOS $ node --version v14.13.0 $ jupyter labextension install jupyterlab-plotly