No KYC · seven Linux VPS plans, one price in six cities · Pay in BTC, USDT, USDC, ETH, SOL, LTC, XMR
Language: English
Configure a VPS

Guide · updates · checked 16 November 2026

How do I enable automatic security updates on a VPS?

Last updated: · 4 min read

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 = yes and 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.

  1. Install the package

    Run apt update then apt install unattended-upgrades.

  2. Switch it on

    Run dpkg-reconfigure -plow unattended-upgrades and answer Yes. It writes /etc/apt/apt.conf.d/20auto-upgrades.

  3. Check the switch file

    That file should contain APT::Periodic::Update-Package-Lists "1"; and APT::Periodic::Unattended-Upgrade "1";.

  4. Choose reboot behaviour

    In /etc/apt/apt.conf.d/50unattended-upgrades, set Unattended-Upgrade::Automatic-Reboot "true"; and a time such as "04:00", or leave it off.

  5. Test with a dry run

    Run unattended-upgrade --dry-run --debug. It lists the packages it would install, without installing them.

  6. Read the log

    Later, check /var/log/unattended-upgrades/unattended-upgrades.log to see what was applied.

How do the two update tools compare?

Same goal, different files: pick the column that matches your system.

unattended-upgrades and dnf-automatic compared for automatic security updates on a VPS
Itemunattended-upgradesdnf-automatic
SystemsDebian 12/13, Ubuntu 22.04/24.04AlmaLinux 10, Rocky Linux 10
Main config file/etc/apt/apt.conf.d/50unattended-upgrades/etc/dnf/automatic.conf
Switch on20auto-upgrades with two Periodic lines set to 1systemctl enable --now dnf-automatic.timer
Security onlyDefault origins are the security pocketsupgrade_type = security
Automatic rebootAutomatic-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, set upgrade_type = security and apply_updates = yes.
  • Optionally set reboot = when-needed to 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)
  1. Ubuntu Server documentation: automatic updates — Canonical (2026-11-16)
  2. UnattendedUpgrades — Debian wiki (2026-11-16)
  3. 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.

From $2.25/mo on 12 months · no KYC

Configure