Skip to content

Lesson 1 of 3

Your first 15 minutes on a new server

1 min

A new VPS is reachable from the whole internet the moment it boots. Do these steps before installing anything else.

1. Log in and update

ssh root@203.0.113.10
apt update && apt upgrade -y

2. Create your own user

Working as root makes every typo dangerous.

adduser deploy
usermod -aG sudo deploy

3. Use SSH keys

From your own computer:

ssh-copy-id deploy@203.0.113.10

Then, in /etc/ssh/sshd_config, set:

PermitRootLogin no
PasswordAuthentication no

and run systemctl restart ssh. Test the new login in a second terminal before closing the first.

4. Turn on the firewall

ufw allow OpenSSH
ufw enable

5. Set the basics

Set the hostname, the timezone (timedatectl set-timezone Africa/Cairo) and enable automatic security updates.

Snapshot the server now. A clean, secured baseline is the best restore point you'll ever have.