Home / Guides

Server guide

How to update a Linux production server safely

Updates fix security holes, and they can also break things. A short routine keeps you safe on both sides.

2 min readUpdated November 2026 by the RootManage teamWorks on Ubuntu, Debian, AlmaLinux and Rocky unless noted

The short answer

Back up first, read what will change, update in a quiet window, restart the services that need it, check the site, and keep a way to roll back.

Before you start

  • A recent backup or snapshot, and a note of how to restore it.
  • A quiet time for the work, and someone who can test the site afterwards.
  • A look at what is running: systemctl list-units --type=service --state=running.

See what will change

terminal
# Debian and Ubuntu
sudo apt update && apt list --upgradable

# AlmaLinux, Rocky, RHEL
sudo dnf check-update

Look for the web server, database, PHP, the kernel and OpenSSL. Those are the updates that can change behaviour.

Apply

terminal
# Debian and Ubuntu
sudo apt upgrade

# AlmaLinux, Rocky, RHEL
sudo dnf upgrade

Read the questions about changed configuration files. Keep your version unless you know why to replace it.

Restart what needs it

terminal
sudo needrestart            # Debian and Ubuntu
sudo needs-restarting -r    # Red Hat family: reboot needed?
ls /var/run/reboot-required

A new kernel needs a reboot. Do it in your quiet window and check that all services came back.

Check

  • The site, the login, a form and the payment path if there is one.
  • systemctl --failed and the error logs.
  • Disk and memory after the update.

Roll back if needed

  • Restore the snapshot or backup.
  • On Red Hat family systems, dnf history undo can reverse a transaction.
  • Hold a problem package until it is fixed: apt-mark hold name.

Automate the small stuff

Turn on automatic security updates for the system packages, and do the larger ones, such as database or PHP versions, by hand and with a test.

Questions people ask

How often should I update?

Apply security updates as soon as practical, within days. Do larger version changes on a plan.

Should I test updates first?

For important servers, yes. Try them on a copy first.

Can you do it for me?

Yes. Patching is part of our managed plans, with a backup first.

Want a person to look at it?

Tell us what you see. We reply with what we think is wrong and what it would take to fix it.