Encrypt a VPS with LUKS and unlock it remotely over SSH
Step-by-step: full-disk encryption on a Debian or Ubuntu VPS with LUKS and dropbear in the initramfs for remote unlock.
Read more →Updated 2026-11-11 · Published by AnonVPS
apt update && apt full-upgrade -y
adduser deploy
usermod -aG sudo deployKeep a second session open when you reload SSH, so a mistake does not lock you out. The out-of-band console is your fallback.
# from your laptop
ssh-copy-id deploy@YOUR-SERVER-IP
# then on the server, in /etc/ssh/sshd_config.d/10-hardening.conf
PasswordAuthentication no
PermitRootLogin no
systemctl reload sshOpen further ports only for services you run.
apt install -y ufw
ufw default deny incoming
ufw default allow outgoing
ufw allow OpenSSH
ufw enableapt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgradesList listening services with ss -tlnp and remove or bind to localhost anything you do not need.
With keys only, brute force cannot succeed, but fail2ban reduces log noise: apt install -y fail2ban.
Use an encrypted backup tool to a different location. Test a restore. A backup you have not restored is a hope, not a backup.
ss -tulpn and check that only expected ports listen./var/log/auth.log for failed attempts.Hardening is not a one-time task. Apply updates, review users and remove software you no longer use. For stored data, consider full-disk encryption.
It reduces noise from scanners but adds no real security. Keys and a firewall do the work.
Update packages, create a normal user, set up SSH keys and enable a firewall.
Yes, once a normal user with sudo works.
Enable automatic security updates and review the server regularly.
Step-by-step: full-disk encryption on a Debian or Ubuntu VPS with LUKS and dropbear in the initramfs for remote unlock.
Read more →Host your own apps on a private VPS: what size to choose for common self-hosted services, backups, updates and where to start.
Read more →Why and how to host a personal VPN on a VPS: what it protects, what it does not, which plan to pick and a minimal WireGuard setup.
Read more →How to publish a website or admin panel as a Tor onion service on a VPS: install, configure, test and keep it private.
Read more →Set up SSH key login, turn off password login and add fail2ban to a VPS. Copy-and-paste commands for Ubuntu 24.04.
Read more →Install Docker and Docker Compose on a VPS, run an app, set restart policies and keep ports safe. Copy-and-paste commands for Ubuntu 24.04.
Read more →