How to Set Up Automatic System Updates on Your VPS
Keep your VPS secure and up-to-date with simple, automated update systems.
Introduction: Updates Matter More Than You Think
System updates patch vulnerabilities, improve performance, and ensure stability. Automating them helps you avoid manual maintenance while keeping your server secure — especially useful if you manage multiple VPS servers.
What Types of Updates Can Be Automated?
- Security updates only – Recommended for most environments
- All package updates – Optional for non-critical servers
You can also set frequency, enable notifications, and control reboot behavior.
How to Set Up Automatic Updates on Ubuntu / Debian
✅ Step 1: Install the unattended-upgrades
Package
sudo apt update
sudo apt install unattended-upgrades
✅ Step 2: Enable Automatic Updates
sudo dpkg-reconfigure --priority=low unattended-upgrades
✅ Step 3: Customize Settings (Optional)
Edit /etc/apt/apt.conf.d/50unattended-upgrades
and /etc/apt/apt.conf.d/10periodic
to fine-tune update behavior:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
How to Set Up Automatic Updates on CentOS / RHEL / AlmaLinux
✅ Step 1: Install the Update Tool
# For CentOS 8+ and AlmaLinux
sudo dnf install dnf-automatic
# For CentOS 7
sudo yum install yum-cron
✅ Step 2: Enable the Update Timer
sudo systemctl enable --now dnf-automatic.timer
✅ Step 3: Configure /etc/dnf/automatic.conf
Set options like auto-reboot, update scope, and notifications.
Automatic Reboots After Updates (Optional)
Enable reboots after kernel or security updates to apply changes automatically.
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Email Notifications (Recommended)
Stay informed of update success or failure with email alerts.
Ubuntu/Debian:
Unattended-Upgrade::Mail "your@email.com";
CentOS/AlmaLinux:
emit_via = email
email_from = updates@yourdomain.com
email_to = you@yourdomain.com
️ Final Touch: Monitor Your System After Updates
- Check logs at
/var/log/unattended-upgrades/
or viajournalctl
- Verify key applications post-update
- Schedule occasional manual checks
✅ Final Thoughts: Secure Your VPS, Automatically
Automating updates is one of the simplest ways to protect your VPS. Whether for a personal project or production server, it helps you stay secure without daily effort.
Set it and forget it — until your next audit.