Create Postgre database with Jupyter notebook remotely
Install Jupyter notebook
-
Since anaconda provides many data science tools within its package. It is nice to install python and jupyter with anaconda. install anaconda datascience tools
Install Postgre database
Make sure pip is updated and python3 is intalled. Install Psycopg2 for jupyter notebook to connect to
our database server
pip install Psycopg2
After installation, we can open the databse
psql -d databsename
Inside our psql database
databasename=# CREATE USER postgre WITH PASSWORD 'postgre' CREATEDB;
To login into our jupyter notebook remotely
- First, we start our jupyter server on remote server with root access
jupyter notebook --allow-root --no-browser --port=8100
- Redirect our local machine port to the remote machine, and connect the jupyter note server
ssh -L 8100:localhost:8100 name@server_ip
- Open a browser, and fire up jupyter notebook
localhost:8100