Decluttering my mind into the web ...
date posted: 2021-Oct-13, last edit date: 2021-Oct-13
Note: This is sufficient for a single user. For multiple users, you need to use jupyterhub.
Step 1: Create and secure a new server in the cloud. In my case I will be using DigitalOcean.
Step 2: Install jupyter (in a virtual environment).
# install pip sudo apt install python3-pip python3-dev # install virtualenv sudo -H pip3 install --upgrade pip sudo -H pip3 install virtualenv # create a new folder mkdir ~/jupyter cd ~/jupyter # create new virtual environment and activate virtualenv jupyter_env source jupyter_env/bin/activate # install jupyter (plus pandas) pip install jupyterlab pandas
Step 3: Setup jupyter.
# setup password jupyter notebook password # create a folder to hold notebooks mkdir ~/notebooks # generate config jupyter notebook --generate-config # enable SSL cd ~/.jupyter openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mykey.key -out mycert.pem # press enter to skip prompts ##################################################################################### # edit / place the following lines in the generated "jupyter_notebook_config.py" file ##################################################################################### # Type your username my_username = u'YOUR_USERNAME' # replace here # Replace 'your_username' with your actual username c.NotebookApp.certfile = u'/home/{}/.jupyter/mycert.pem'.format(my_username) c.NotebookApp.keyfile = u'/home/{}/.jupyter/mykey.key'.format(my_username) # Allow remote connections c.NotebookApp.ip = '*' # Save Notebooks under your home folder. # Replace 'your_username' with your actual username c.NotebookApp.notebook_dir = '/home/{}/notebooks/'.format(my_username) # Do not open browser when Jupyter Notebooks start c.NotebookApp.open_browser = False # It is a good idea to set a known, fixed port for server access c.NotebookApp.port = 8888
Step 4: Open port and run server.
# allow access to jupyter port sudo ufw allow 8888 # check that you are able to access the server nohup jupyter lab &
Final result:
References:
# | Post Title | Date Posted | Last Edit Date |
---|---|---|---|
1 | New tools for data analysis (ipython-sql and Azure Data Studio) | 2021-10-16 | 2021-10-16 |
2 | current post -- How to setup a remote jupyter server | 2021-10-13 | 2021-10-13 |
3 | How to setup ZSH | 2021-10-12 | 2021-10-12 |
4 | Concepts in Data Architecture | 2021-05-01 | 2021-10-16 |
5 | Loading data into PostgreSQL reference | 2021-03-19 | 2021-03-19 |
6 | SQLite <--> Pandas reference | 2021-03-15 | 2021-03-15 |
7 | Creating an automated data mart (in SQL) | 2020-07-16 | 2020-07-16 |
8 | Personal finance management and open banking | 2020-07-12 | 2020-07-12 |
9 | Quick SQL reference | 2020-07-03 | 2020-11-29 |
10 | How to back up Digital Ocean Spaces (S3 compatible storage) | 2020-06-07 | 2020-07-03 |
11 | PostgreSQL initiation | 2020-05-25 | 2020-06-01 |