How to enable automatic security updates
Updated 7/20/2026
Most breaches exploit old vulnerabilities that already have a patch. Automatic security updates keep you protected with no effort.
1. Install
apt-get update -y
apt-get install -y unattended-upgrades
2. Enable
dpkg-reconfigure --priority=low unattended-upgrades
Choose "Yes" when asked about automatically installing security updates.
3. Check the configuration
In /etc/apt/apt.conf.d/50unattended-upgrades you can also enable automatic reboots (useful for kernel patches):
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "04:00";
4. Test manually
unattended-upgrade --dry-run --debug
Note
For critical production servers, test updates first on a staging server. With hourly billing you can spin up a temporary test server and delete it right after.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to scan your server for malware with ClamAV
Install ClamAV, an open-source antivirus, and periodically scan your server for infected files.
Updated 7/20/2026SecurityHow to check which ports are open on your server
Find out which services are listening for connections on your server and close what you do not need, for less exposure.
Updated 7/20/2026SecurityHow to add security headers to your website
A few HTTP headers protect your visitors from common attacks like clickjacking and content injection.
Updated 7/20/2026