Docs / Server Management / How to Set Up Unattended Upgrades on Debian

How to Set Up Unattended Upgrades on Debian

By Admin · Feb 25, 2026 · Updated Apr 24, 2026 · 431 views · 1 min read

Keep your Debian server automatically patched with security updates.

Install

apt install unattended-upgrades apt-listchanges -y

Enable

dpkg-reconfigure -plow unattended-upgrades

Configuration

Edit /etc/apt/apt.conf.d/50unattended-upgrades:

Unattended-Upgrade::Allowed-Origins {\n    "${distro_id}:${distro_codename}-security";\n};\n\n// Auto-reboot if needed (at 4 AM)\nUnattended-Upgrade::Automatic-Reboot "true";\nUnattended-Upgrade::Automatic-Reboot-Time "04:00";

Check Logs

cat /var/log/unattended-upgrades/unattended-upgrades.log

Was this article helpful?