xigang365

xigang365

Running Jupyter on a Linux server and enabling remote access

Installing Anaconda#

  1. Download and install using the Tsinghua Open Source Mirror for accelerated download and installation.
  2. After installation, modify the installation source of conda for acceleration.

Installing Jupyter#

conda install jupyter

Configuring Jupyter#

1. Generate a password#

jupyter-notebook password
# Enter the password twice to generate ~/.jupyter/jupyter_notebook_config.json
cat ~/.jupyter/jupyter_notebook_config.json
# Take note of the password, it will be needed in the next step

2. Generate a configuration file#

jupyter-notebook --generate-config
# The generated configuration file is saved by default in ~/.jupyter/jupyter_notebook_config.py

3. Modify the configuration file#

vim ~/.jupyter/jupyter_notebook_config.py
# Since all the content inside is already commented out, we will directly append at the end
c.NotebookApp.ip = '*' # Listen on all IP addresses
c.NotebookApp.open_browser = False # Do not open the browser by default
c.NotebookApp.password = 'xxxx' # Use the password from the first step
c.NotebookApp.port = xxxx # Access port, please make sure this port is not occupied and can be accessed through the network
c.NotebookApp.notebook_dir = 'xxxxx' # Set the root directory for Jupyter Notebook to open

4. Running#

# Test run
jupyter-notebook
# Run in the background
nohup jupyter-notebook
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.