Quick answer
How do I enable automatic security updates on a VPS?
To enable automatic security updates, install unattended-upgrades on Ubuntu or Debian and run dpkg-reconfigure -plow unattended-upgrades, or install dnf-automatic on AlmaLinux and Rocky Linux and enable its timer. Both apply security patches once a day. They run the same way on all 6 SaltVPS images.
In brief
- Debian and Ubuntu: unattended-upgrades, switched on by two lines in
20auto-upgrades. - AlmaLinux and Rocky Linux: dnf-automatic with
apply_updates = yesand a systemd timer. - Scope: security updates only by default, which keeps surprises rare.
- Reboots: kernel updates need one; you choose whether it happens on its own.
- Check: a dry run shows what would be installed.
How do you enable automatic security updates on Ubuntu or Debian?
Run as root. Ubuntu images often have the package already; the steps confirm it is on.
Install the package
Run
apt updatethenapt install unattended-upgrades.Switch it on
Run
dpkg-reconfigure -plow unattended-upgradesand answer Yes. It writes/etc/apt/apt.conf.d/20auto-upgrades.Check the switch file
That file should contain
APT::Periodic::Update-Package-Lists "1";andAPT::Periodic::Unattended-Upgrade "1";.Choose reboot behaviour
In
/etc/apt/apt.conf.d/50unattended-upgrades, setUnattended-Upgrade::Automatic-Reboot "true";and a time such as "04:00", or leave it off.Test with a dry run
Run
unattended-upgrade --dry-run --debug. It lists the packages it would install, without installing them.Read the log
Later, check
/var/log/unattended-upgrades/unattended-upgrades.logto see what was applied.
How do the two update tools compare?
Same goal, different files: pick the column that matches your system.
| Item | unattended-upgrades | dnf-automatic |
|---|---|---|
| Systems | Debian 12/13, Ubuntu 22.04/24.04 | AlmaLinux 10, Rocky Linux 10 |
| Main config file | /etc/apt/apt.conf.d/50unattended-upgrades | /etc/dnf/automatic.conf |
| Switch on | 20auto-upgrades with two Periodic lines set to 1 | systemctl enable --now dnf-automatic.timer |
| Security only | Default origins are the security pockets | upgrade_type = security |
| Automatic reboot | Automatic-Reboot "true" | reboot = when-needed |
| Log | /var/log/unattended-upgrades/ | journalctl -u dnf-automatic |
How do you enable automatic updates on AlmaLinux or Rocky Linux?
Install dnf-automatic, set it to apply security updates, then start its timer.
dnf install dnf-automatic- In
/etc/dnf/automatic.conf, setupgrade_type = securityandapply_updates = yes. - Optionally set
reboot = when-neededto restart after kernel updates. systemctl enable --now dnf-automatic.timer
Run systemctl list-timers dnf-automatic.timer to see the next run time.
Should the server reboot on its own after updates?
Turn it on for servers that can take a short break at night; leave it off where uptime matters more. A new kernel only takes effect after a reboot. On Debian and Ubuntu, the file /var/run/reboot-required appears when one is pending.
Containers set to restart, such as a trading bot in Docker, come back by themselves. A reboot you start from inside the server is immediate; one sent from the SaltVPS dashboard is carried out by a person, as the reboot and reinstall page explains.
What do automatic updates not cover?
Software installed outside the package manager, and your data. Docker images, Python packages and apps you copied in by hand need their own update routine; for Docker, docker compose pull then docker compose up -d.
Updates also cannot undo a mistake. SaltVPS checked its plan list on 16 November 2026: none of the 7 plans includes backups, so set up the backup guide too. Both are steps of the Linux VPS security guide.
How can you tell the updates are really running?
Check the timers, then the logs, a day after setup. On Debian and Ubuntu, systemctl list-timers apt-daily-upgrade.timer shows when the next run is due. The history of installed packages sits in /var/log/apt/history.log. On AlmaLinux and Rocky Linux, dnf history lists each transaction with its date.
If nothing has run after two days, check that 20auto-upgrades holds both lines set to 1, or that the dnf-automatic timer is enabled. A quick look once a month is enough after that.
Automatic update questions
Are automatic security updates safe on a server?
Security updates in stable releases are small and tested. Breakage is rare; skipped patches are the bigger risk on a public server.
How do I enable automatic security updates on Ubuntu 24.04?
Install unattended-upgrades if missing, run dpkg-reconfigure -plow unattended-upgrades, then test with unattended-upgrade --dry-run.
Can I include all updates, not just security?
Yes. Add the updates origin in 50unattended-upgrades, or set upgrade_type = default in automatic.conf. Expect more changes.
How do I keep one package from updating?
Add it to Unattended-Upgrade::Package-Blacklist, or hold it with apt-mark hold. With dnf, use exclude in the config.
Can it email me a report?
Yes, if the server can send mail. On SaltVPS, port 25 is closed, so relay through a mail provider on port 465 or 587.
Verdict
- Enabling automatic security updates takes one package and a two-line switch.
- Decide on reboots up front, and keep backups for what updates cannot fix.
Sources (3)
- Ubuntu Server documentation: automatic updates — Canonical (2026-11-16)
- UnattendedUpgrades — Debian wiki (2026-11-16)
- DNF Automatic — DNF project (2026-11-16)
Run a patched server
Flake runs Ubuntu, Debian, AlmaLinux or Rocky Linux, with root over SSH and no setup fee.
- Built by a person, 1 hour at most after confirmation
- Lost days credited back if a server cannot be delivered
- Pay in BTC, XMR, USDT, USDC, ETH, SOL or LTC
- DomaineGoat LLC · Panama