Back to articles
DevOps & Systems

Running Jupyter Notebook Server on VPS: Turn Any Device into a Professional Data Science Tool

A detailed guide to running a Jupyter Notebook Server on VPS, turning any device into a professional data science tool. Covers installation, security configuration, remote access,...

DPTCloud Engineering4 min read
Running Jupyter Notebook Server on VPS: Turn Any Device into a Professional Data Science Tool

Introduction

Running a Jupyter Notebook Server on a VPS allows you to turn any device—from a personal computer to a smartphone—into a professional data science tool. With remote access, large data processing capabilities, and integration with popular Python libraries, Jupyter Notebook is ideal for Data Science, Machine Learning, and data analysis. In this guide, we will set up a Jupyter Notebook Server on a VPS, configure security, and enable safe remote access.

Prerequisites and Preparation

Before starting, ensure you have:

  • A Linux-based VPS (Ubuntu 20.04/22.04 or Debian 11/12)
  • Root or sudo user access
  • A stable internet connection
  • SSH access to the VPS

Setting Up the Jupyter Notebook Server

Run the following commands on your VPS to install Jupyter Notebook:

sudo apt update
sudo apt upgrade -y
sudo apt install python3-pip python3-venv -y
python3 -m venv jupyter_env
source jupyter_env/bin/activate
pip install jupyter notebook

After installation, start Jupyter Notebook with:

jupyter notebook --no-browser --port=8888 --ip=0.0.0.0

Notes: Change 8888 if needed. The --ip=0.0.0.0 parameter enables remote access.

Security Configuration

To ensure safety, use:

  • A strong password for Jupyter Notebook
  • Generate a Jupyter configuration file:
jupyter notebook --generate-config

Open ~/.jupyter/jupyter_notebook_config.py and add the following lines:

c.NotebookApp.password = u'sha1:your_hashed_password'
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = 8888
c.NotebookApp.open_browser = False
c.NotebookApp.token = ''

To generate a password hash, run:

python -c "from notebook.auth import passwd; print(passwd())"

Replace your_hashed_password with the output.

Remote Access

To access Jupyter Notebook from another device, open port 8888 on the firewall:

sudo ufw allow 8888/tcp

Access via a browser at:

http://:8888

Enter the configured password to log in.

Performance Optimization and Management

To optimize performance, consider:

Verification

After setup, verify functionality by:

  1. Running jupyter notebook on the VPS
  2. Accessing http://:8888 from another device
  3. Creating a new notebook and running a simple Python command like print("Hello, Data Science!")

Troubleshooting

References

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478