[PYTHON] Jupyter Notebook Settings-How to use (EC2 Amazon Linux 2)

How to use Jupyter Notebook

How to start when you want to open from the web without a screen such as executing on the server. This time it runs on EC2 (amazon linux2)

#password setting(If you don't give a password, skip it)
$ ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password:
Verify password: 
Out[3]: 'sha1:...' #Make a copy of the encrypted string
	
#Login as root user
$ sudo su - 
$ mkdir /root/.jupyter
$ cd /root/.jupyter
$ openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mykey.key-out mycert.pem
	
#jupyter notebook initial settings
$ vi /root/.jupyter/jupyter_notebook_config.py
c = get_config()
c.NotebookApp.ip='0.0.0.0' #Can be accessed from any IP address
c.NotebookApp.password = u'sha1:...' #The copied character string(If you don't give a password, don't write)
c.NotebookApp.open_browser=False #Do not open browser automatically when jupyter starts
c.NotebookApp.port=8888 #Server port this time 8888
c.NotebookApp.certfile = u'/root/.jupyter/mycert.pem' #Server certificate
c.NotebookApp.keyfile  = u'/root/.jupyter/mykey.key' #Private key
c.NotebookApp.notebook_dir = '/root/work' #Arbitrary folder
	
#open jupyter notebook
$ jupyter notebook --ip='0.0.0.0' --allow-root &

#After starting, "http~~~/~~token=I think that "xxxxxxxxxxx" will appear in the standard output, so copy the xxxxxxxxxx part

Launch IE and enter the IP and port in the url field to launch it.

http://xxx.xxx.xxx.xxx(EC2 Global IP):yyyy/
 xxx.xxx.xxx.xxx: EC2 global IP
 yyyy:jupyter_notebook_config.Port set to py(Is the default 8888?)

Recommended Posts

Jupyter Notebook Settings-How to use (EC2 Amazon Linux 2)
How to use Jupyter Notebook
Easy to use Jupyter notebook (Python3.5)
Use Jupyter Lab and Jupyter Notebook with EC2
How to use jupyter notebook with ABCI
Jupyter Notebook Basics of how to use
How to use Jupyter notebook [Super Basic]
Copy files directly from Amazon EC2 (Amazon linux) to S3
AWS EC2 2nd SSH connection to EC2 Instance (Amazon Linux2)
[AWS EC2] How to install Maven on Amazon Linux 2
Introduced Jupyter Notebook to CentOS 7
Use pip with Jupyter Notebook
How to use IPython Notebook
Use Cython with Jupyter Notebook
Use sshpass on Amazon linux2
I want to use a virtual environment with jupyter notebook!
[AWS EC2] Settings you want to do on Amazon Linux 2
How to install wkhtmltopdf (Amazon Linux2)
Use markdown with jupyter notebook (with shortcut)
Introducing Amplify to Amazon Linux 2 AMI
Add users with SSH access to your Amazon EC2 Linux instance
I'll install Ruby on EC2 (Amazon Linux2) 2020
Use nb extensions with Anaconda's Jupyter notebook
Markdown to get Jupyter notebook results to Qiita
I wanted to use jupyter notebook with docker in pip environment (opticspy)
Use apache Spark with jupyter notebook (IPython notebook)
Specify the browser to use with Jupyter Notebook. Especially Mac. (And Vivaldi)
I want to blog with Jupyter Notebook
Use Numpy, Scipy, scikit-learn on Amazon Linux
[Linux] How to use the echo command
I want to use Linux on mac
How to use the Linux grep command
How to update php on Amazon linux 2
How to execute commands in jupyter notebook
Use BigQuery from your local Jupyter Notebook
How to set up a jupyter notebook on ssh destination (AWS EC2)
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
How to install Anisble on Amazon Linux 2
Let's make jupyter lab easy to use
Use vim keybindings on Docker-launched Jupyter Notebook
Use notebook applications to develop customized visualizations 2
[Amazon Linux] Switching from Python 2 series to Python 3 series
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
Use jupyter notebook by connecting from another host
How to debug with Jupyter or iPython Notebook
Creating an AWS EC2 EC2 Instance (Amazon Linux AMI) 2
Added firewalld to Amazon Linux 2 (IP address restrictions)
Add / remove kernel to use jupyter with venv
I tried to start Jupyter with Amazon lightsail
Launch Jupyter notebook / termial by right-clicking [Win / Linux]
Introducing Spark to EC2 and linking iPython Notebook
Jupyter Notebook memo
Introducing Jupyter Notebook
Why use linux
Use ipywidgets in jupyter notebook to interactively manipulate parameters and also try image processing
Powerful Jupyter Notebook
Jupyter notebook password
Jupyter Notebook memo
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
Convert jupyter notebook .ipynb files to python executable .py files
Customize Jupyter notebook shortcuts to look like sublime text