AGP Resources • Updated: Nov 12, 2025 • Level: Intermediate

Server Recipes — 4 Quick Labs to Learn VPS Basics

These short, hands-on labs are designed for classroom use. Each recipe takes ~30–60 minutes and teaches a core server skill: provisioning, web deployment, securing SSH, and automating backups.

Lab 1 — Provision & Prepare (Ubuntu)

Goal: Prepare a clean VPS for student projects.

# create a non-root user & update
sudo adduser student
sudo usermod -aG sudo student
sudo apt update && sudo apt upgrade -y
# install essentials
sudo apt install -y git curl build-essential
        

Lab 2 — Deploy a Python Flask App

Quick start using gunicorn + systemd

# on VPS
git clone https://github.com/example/flask-demo.git
cd flask-demo
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# create systemd service and start
sudo systemctl enable --now flask-demo
          

Lab 3 — SSH Hardening

Essential steps to secure access

# disable root login, use key auth
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo systemctl restart sshd
          

Lab 4 — Backups & Snapshots

Automated backups for important student work

# simple rsync backup to remote storage (cron)
rsync -avz /home/student/projects/ [email protected]:/backups/student-projects/
# add cron job to run nightly
crontab -e
0 3 * * * /usr/bin/rsync -avz /home/student/projects/ [email protected]:/backups/student-projects/
        

Teaching Notes & Assessment

Each lab includes a short assessment: students must submit a repo with deployment logs, a short README, and an architecture diagram. Encourage reproducibility and use version control for grading.

Further reading