Debian setup is almost the same as Ubuntu — both are apt-based — with a couple of Debian-specific gotchas worth knowing (sudo isn't always there; the image is more minimal). Here's the first ten minutes on a fresh Debian 12 box.
1. Update the system
apt update && apt upgrade -y
2. Install sudo (Debian often lacks it) and make a user
apt install -y sudo curl
adduser deploy # set a password when prompted
usermod -aG sudo deploy
The sudo install is the main Debian difference — minimal images ship without it.
3. Add your SSH key to the user
Install your public key (generating one):
mkdir -p /home/deploy/.ssh
nano /home/deploy/.ssh/authorized_keys # paste your PUBLIC key
chown -R deploy:deploy /home/deploy/.ssh
chmod 700 /home/deploy/.ssh && chmod 600 /home/deploy/.ssh/authorized_keys
Confirm ssh deploy@YOUR.SERVER.IP works in a second terminal before continuing.
4. Disable password and root SSH login
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sudo systemctl restart ssh
5. Firewall (install then enable)
Debian minimal may not have UFW:
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw enable
See configure a UFW firewall for opening app ports.
6. Automatic security updates
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades # choose "Yes"
Next steps
Patched, off root, key-only, firewalled. From here: install Docker, set up an nginx reverse proxy, or run the full new-VPS security checklist. EQVPS offers clean Debian 12 (and Ubuntu, AlmaLinux) images with root in about a minute, no KYC, paid in crypto.
Comments
No comments yet. Be the first.