Skip to content
VeloxMedia
VPS guide

Turn On Automatic Security Updates on Your VPS

Most server compromises exploit vulnerabilities that were patched weeks or months earlier. Automatic security updates close that window without you having to remember to log in.

Beginner · About 3 min read · Updated 27 October 2026

Security updates versus all updates

Applying every update automatically can change application behaviour. Applying only security updates is low risk and covers what attackers actually use. The configurations below install security fixes automatically and leave feature upgrades to you.

Ubuntu and Debian: unattended-upgrades

sudo apt install -y unattended-upgrades apt-listchanges
sudo dpkg-reconfigure -plow unattended-upgrades

Answer yes. This writes /etc/apt/apt.conf.d/20auto-upgrades, which should contain:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

The policy lives in /etc/apt/apt.conf.d/50unattended-upgrades. The defaults allow only the security origin. Useful settings to review there:

Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "false";
Unattended-Upgrade::Mail "[email protected]";

Mail delivery needs a working mail transfer agent on the server; skip it if you check logs instead.

Test without changing anything:

sudo unattended-upgrade --dry-run --debug

Logs are written to /var/log/unattended-upgrades/.

AlmaLinux, Rocky Linux and Fedora: dnf-automatic

sudo dnf install -y dnf-automatic

Edit /etc/dnf/automatic.conf:

[commands]
upgrade_type = security
download_updates = yes
apply_updates = yes

Then enable the timer:

sudo systemctl enable --now dnf-automatic.timer
systemctl list-timers dnf-automatic.timer

Run history is available with sudo dnf history and journalctl -u dnf-automatic.

Handling reboots

Kernel and core library fixes only take effect after a reboot. Three approaches, from simplest to most controlled:

  1. Automatic reboots at a quiet hour. On Ubuntu and Debian set Automatic-Reboot "true" and Automatic-Reboot-Time "04:00". Suitable for stateless web servers and personal projects.
  2. Reboot when flagged, on your schedule. Check /var/run/reboot-required (Debian family) or run sudo dnf needs-restarting -r (RHEL family) from a weekly maintenance script.
  3. Restart services only. needrestart on Debian-based systems restarts daemons that use updated libraries, which covers most fixes without a full reboot.

Because VeloxMedia uses live migration for host maintenance, the platform itself never needs to reboot your server; reboots are only ever for updates inside your OS.

Do not forget applications

OS updates do not patch software you installed outside the package manager. Keep a short list of what needs manual attention, for example WordPress and its plugins, Docker images (docker compose pull), language packages and anything built from source. The vulnerability monitoring in the VeloxMedia control panel scans for known CVEs and exposed services, which helps catch what slips through.

Before big upgrades

Automatic security patching is routine. Major version upgrades are not. Take a snapshot from the control panel first; if anything breaks, restoring takes a few clicks.

Common questions

Is it safe to enable automatic updates on a server?

Automatically applying security updates only is low risk and strongly recommended. Feature upgrades and major version changes are better applied manually after a snapshot.

Do automatic updates reboot my server?

Not by default. Kernel updates need a reboot to take effect, so either enable automatic reboots at a quiet hour or check the reboot-required flag and reboot on your own schedule.

How do I check that unattended-upgrades is working?

Run unattended-upgrade --dry-run --debug and look at the logs in /var/log/unattended-upgrades/. On RHEL-family systems, check the dnf-automatic timer and its journal.

Do OS updates also update Docker containers and WordPress?

No. Container images, WordPress core and plugins, and language packages installed outside the system package manager need their own update routine.

Deploy your first server in under a minute

Pick a region, choose a size and connect over SSH. No setup fees, cancel anytime.