Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Run Updates on Your Virtual Private Server

Updates fix bugs and security holes. This guide shows how to update a Linux VPS. It needs root access.

VPS and Cloud Servers2 min read6 steps

Why update?

A VPS is a private slice of a big computer. You look after it yourself. Old software can have holes that hackers use. Updates close those holes and also fix errors. Running them often is one of the best ways to stay safe.

Warning

An update can change how programs work. Some updates need a restart, which takes the site offline for a short time. Take a backup or snapshot before you start. A snapshot is a saved copy of your whole server at one moment.

Ubuntu or Debian

  1. Connect to your server with SSH:
ssh root@your-server-ip
  1. Refresh the list of available updates:
sudo apt update

This only checks what is new. It does not install anything.

  1. Install the updates:
sudo apt upgrade -y

This installs the new versions of the software you already have.

  1. Remove packages you no longer need:
sudo apt autoremove -y

CentOS, AlmaLinux or Rocky Linux

  1. Connect with SSH.
  2. Run the update:
sudo yum update -y

On newer versions, you can use sudo dnf update -y in the same way.

Tip: CentOS 7 is old, and it no longer gets updates. Newer systems use similar commands.

Check if a reboot is needed

On Ubuntu, this file appears when a restart is needed:

ls /var/run/reboot-required

If the file exists, restart at a quiet time with sudo reboot.

If you use a control panel

Panels like cPanel have their own update system. Update the panel and the operating system as that panel advises. Do not mix tools without reading the panel's notes.

Automatic security updates

On Ubuntu you can turn on automatic security updates:

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

This installs the helper and starts the setup screen. Choose Yes.

Tip: Update at a quiet time, such as late at night, when fewer visitors are on your site.

Quick recap

  • Back up or take a snapshot first.
  • Ubuntu and Debian: apt update, then apt upgrade.
  • CentOS family: yum update or dnf update.
  • Reboot if the system asks for it.
  • Consider automatic security updates.