Debian
Package management, updates, release upgrades, and firewall setup on a Debian VPS.
Our Debian image is the official Debian generic cloud image, provisioned with cloud-init. For help deciding whether Debian is right for you, see Choosing a Linux distribution.
What’s in the image
- Packages: a minimal Debian install with
apt, OpenSSH, andcloud-init. - Networking: configured by
cloud-initat boot. See VPS networking for how your addresses are assigned. - Firewall: the cloud image doesn’t ship with an active firewall. See Set up a firewall.
To check which Debian release you’re running:
cat /etc/debian_versionInstall packages
Debian uses apt to install packages. Refresh the package lists first, then install:
sudo apt update
sudo apt install htopTo search for a package:
apt search htopUpdate your system
To install the latest updates:
sudo apt update
sudo apt full-upgradeReboot if the update installed a new kernel.
Automatic updates
Debian can install security updates automatically with unattended-upgrades:
sudo apt install unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgradesAnswer Yes when asked whether to automatically download and install stable updates.
Upgrade to a new Debian release
A new Debian release comes out about every two years. Each release gets about three years of security support from Debian, followed by two more years of Debian LTS.
To upgrade, follow the upgrade chapter of the new release’s release notes. The process is roughly:
- Fully update your current release and take a backup.
- Replace the old release’s codename with the new one in your APT sources, under
/etc/apt/sources.list.d/or in/etc/apt/sources.list. - Run
sudo apt update, thensudo apt upgrade --without-new-pkgs, thensudo apt full-upgrade. - Reboot.
Only upgrade one release at a time.
Set up a firewall
Our hardening guide walks through setting up UFW on Debian.