VPS 101: Basics, Security, and Cool Things You Can Do

2 minutes read

Server Rack A Virtual Private Server (VPS) is like renting a small slice of a powerful computer in a data center. It looks and feels like your own Linux or Windows machine, but it runs on shared physical hardware.

This guide covers:


What is a VPS?

Compared to shared hosting, a VPS gives you:

✅ Root access
✅ Flexibility to install anything
✅ Better performance and isolation

Common providers:


Getting Started

After ordering your VPS, you typically get:

Connect via SSH:

ssh root@203.0.113.5

First steps:

  1. Update packages:
   apt update && apt upgrade
  1. Create a new user:

    adduser myuser
    usermod -aG sudo myuser
    
  2. Add SSH keys:

    mkdir -p /home/myuser/.ssh
    nano /home/myuser/.ssh/authorized_keys
    

    Paste your public key, save, and set permissions:

    chmod 600 /home/myuser/.ssh/authorized_keys
    chown -R myuser:myuser /home/myuser/.ssh
    
  3. Disable root SSH login:

    Edit /etc/ssh/sshd_config:

    PermitRootLogin no
    PasswordAuthentication no
    

    Restart SSH:

    systemctl restart ssh
    

Hardening Your VPS

Securing your server is critical. Here are essentials:

Firewall (UFW):

ufw allow OpenSSH
ufw enable

Fail2ban (brute force protection):

apt install fail2ban
systemctl enable fail2ban --now

Automatic security updates:

apt install unattended-upgrades
dpkg-reconfigure --priority=low unattended-upgrades

Minimal services:

Disable unused services:

systemctl list-unit-files --type=service
systemctl disable <service>

Regular backups:


Useful Things You Can Do with a VPS

Once secured, you can do all sorts of fun or productive stuff:

🎯 Host a Website or Blog

🎯 Run a Private Git Server

🎯 Create a VPN

🎯 Self-host Applications

🎯 Automate Tasks

🎯 Experiment & Learn


Final Thoughts

Owning a VPS feels like owning a little piece of the internet.
If you secure it properly and keep it updated, it’s an incredibly powerful tool for learning, hosting, and creating.