Turning on automatic security updates
Install security fixes automatically on Debian, Ubuntu, AlmaLinux and Rocky Linux, and choose when reboots happen.
1 min read · Updated on
Security flaws are fixed regularly. Applying those fixes promptly is one of the most effective protections for a server exposed to the Internet.
Debian and Ubuntu
Install and enable unattended-upgrades:
apt update
apt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades
Answer Yes. By default, only security updates are installed, once a day.
Some updates, such as kernel updates, only take effect after a reboot. To reboot automatically at a quiet time, add to /etc/apt/apt.conf.d/50unattended-upgrades:
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "04:00";
To check the configuration without installing anything:
unattended-upgrade --dry-run --debug
Logs are in /var/log/unattended-upgrades/.
AlmaLinux and Rocky Linux
Install dnf-automatic:
dnf install -y dnf-automatic
In /etc/dnf/automatic.conf, set:
[commands]
upgrade_type = security
apply_updates = yes
Then enable the timer:
systemctl enable --now dnf-automatic.timer
What about reboots?
A server that never reboots keeps running the old kernel. Schedule a reboot at an off-peak time, or reboot it yourself from the client area after important updates.
Further reading
Securing a Linux server after installation
The essential settings to take care of in the first hour: updates, a dedicated user, SSH keys, a firewall and protection against brute-force attacks.
How many vCPU, how much memory and storage for my VPS?
Practical guidelines to size your VPS for your project, and how to tell when it is time to add resources.
Paying your invoice by Interac e-Transfer
How to pay an invoice by Interac e-Transfer: amount, recipient, message and security question. Your server is then delivered automatically.

