How to Set Up Automatic Updates on Ubuntu
Keeping your server up to date is essential for security. Ubuntu's unattended-upgrades package handles this automatically.
Install unattended-upgrades
sudo apt install unattended-upgrades
Enable Automatic Updates
sudo dpkg-reconfigure --priority=low unattended-upgrades
Configure Update Behavior
Edit /etc/apt/apt.conf.d/50unattended-upgrades to control which packages are updated and whether the server auto-reboots:
Unattended-Upgrade::Automatic-Reboot "true"; Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Verify the Service
sudo systemctl status unattended-upgrades