Upgrading your server’s operating system ensures that your applications remain secure, stable, and compatible with modern software.

Ubuntu 18.04 has reached its end of life and no longer receives critical PHP updates or security patches. To ensure your server continues receiving security fixes for modern PHP versions, you must upgrade your operating system to Ubuntu 20.04 or later.

This guide explains how to perform an in-place operating system upgrade from Ubuntu 18.04 to Ubuntu 20.04 on a RunCloud-managed server.

Before You Begin

An in-place operating system upgrade replaces core system packages while your data remains on the disk. Because this is a major system transition, unexpected issues can cause server downtime or boot failures.

Before proceeding, review the following requirements:

  • Create a full snapshot: Log in to your cloud server provider (such as DigitalOcean, Vultr, or Linode) and create a full server snapshot or backup. If anything goes wrong during the upgrade, you can restore this snapshot immediately.
  • Schedule a maintenance window: Your web applications will be offline during the upgrade and server reboot. Inform your website visitors of planned downtime.
  • Locate your provider’s emergency console: Make sure you know how to access your server provider’s emergency web terminal (VNC or serial console). If your SSH connection drops during the upgrade, the console allows you to log in directly.

Alternative: Migrate to a New Server

Upgrading an operating system in place carries inherent risks. Whenever possible, we strongly recommend deploying a fresh server running a newer Ubuntu release through RunCloud and cloning your web applications to it. This approach allows you to test your websites thoroughly without experiencing unintended downtime. You should only use an in-place upgrade if migrating your applications to a new server is not feasible.

System Compatibility Overview

DetailSpecification
Applies toAll RunCloud servers running Ubuntu 18.04 (NGINX, NGINX + Apache, OpenLiteSpeed, LiteSpeed Enterprise)
Target VersionUbuntu 20.04 LTS
Access RequiredRoot access via SSH and web console access via your hosting provider

Step-by-Step In-Place Upgrade Instructions

Follow these steps carefully in sequence. Ensure you are connected to your server via SSH as the root user before starting.

  1. Open your RunCloud dashboard and navigate to Servers > Your Server Name > Security > Firewall.
  2. Click Add New Rule.
  3. Create a rule to allow inbound TCP traffic on port 1022. During the upgrade, Ubuntu launches an emergency backup SSH server on this port to prevent you from being locked out if your main session disconnects.
  4. If your cloud hosting provider has an external network firewall, open port 1022 in that dashboard as well.
  5. In your RunCloud dashboard, navigate to Web Applications and check the PHP version of each web application hosted on the server.
  6. Switch any web applications running PHP 7.0 or PHP 7.1 to PHP 7.2 or a newer version, because Ubuntu 20.04 does not support PHP 7.0 or 7.1.
  7. In your RunCloud dashboard, navigate to Servers > Your Server Name > Settings and update the default PHP CLI version to PHP 7.2 or newer.
  8. Connect to your server terminal as root using SSH.
  9. Verify whether your package sources use a custom cloud mirror by inspecting /etc/apt/sources.list. If you use DigitalOcean, point the package manager to the official Ubuntu archives by running:
sed -i 's/mirrors.digitalocean.com/archive.ubuntu.com/g' /etc/apt/sources.list

Note: If you use a different hosting provider that uses a custom mirror, replace mirrors.digitalocean.com with the repository address listed in your file. If your file already lists archive.ubuntu.com, skip this step.

  1. Update your existing package lists to the latest available releases:
apt update && apt upgrade -y

If a terminal prompt asks whether you want to replace an existing configuration file, choose the option to keep your currently installed local version.

  1. Run the distribution upgrade command to handle changing dependencies:
apt dist-upgrade -y
  1. Reboot your server to initialize the updated kernel and core packages:
reboot
  1. Wait a few moments for the server to restart, then log in again through SSH as root.
  2. Start the Ubuntu release upgrade tool:
do-release-upgrade
  1. Follow the interactive prompts in your terminal:
    • When prompted to start an additional SSH daemon on port 1022, enter y and press Enter.
    • When asked whether you want to continue with the upgrade process, enter y and press Enter.
    • Whenever you are asked whether to replace an existing configuration file, choose to keep your local version.
    • Press Enter on informational screens to dismiss them.
  2. When the terminal prompts that the upgrade has finished and asks to restart the system, enter y or run:
reboot
  1. Log back into your server using SSH as root once the reboot completes.
  2. Check the directory containing third-party repository lists:
ls /etc/apt/sources.list.d/

The upgrade process comments out all third-party repositories automatically to prevent installation conflicts.

  1. Re-enable the RunCloud repository by opening the file in a text editor:
nano /etc/apt/sources.list.d/runcloud.list
  1. Remove the # character from the start of the repository line to uncomment it, then save and exit the editor.
  2. Repeat this edit for any other required repositories in /etc/apt/sources.list.d/, such as LiteSpeed or OpenLiteSpeed repositories, by removing the leading # symbols.
  3. Restore DNS resolution handling so your server can resolve domain names correctly:
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl unmask systemd-resolved
systemctl enable systemd-resolved
systemctl restart systemd-resolved
  1. Refresh your package lists and clean temporary cache files:
apt-get clean
apt-get update
  1. Install the RunCloud Agent package along with its necessary system dependencies:
apt install libsensors-config runcloud-agent -y
  1. Clear the old registration file and restart the agent service so it can reconnect to the RunCloud platform:
rm /RunCloud/Packages/RunCloudAgent/.runcloud-agent-registered
systemctl restart runcloud-agent

Verifying the Upgrade

After completing the steps above, confirm that your server is running the correct operating system version and communicating with RunCloud properly:

  1. Check your installed operating system release:
lsb_release -a
  1. Verify that the RunCloud Agent is active:
systemctl status runcloud-agent

Look for the status indicator marked as “active (running)”.

  1. Open the RunCloud dashboard, navigate to your server, and verify that the operating system is displayed as “Ubuntu 20.04” with an online status.
  2. Visit your web applications in a browser and test major functionality, such as user logins, database interactions, and checkout processes.
  3. In your RunCloud dashboard, navigate to Servers > Your Server Name > Security > Firewall and delete the rule allowing traffic on port 1022.
  4. Remove the port 1022 rule from your cloud provider’s external firewall if you configured one earlier.

If you encounter any unexpected issues during or after the upgrade, our support team is ready to assist you. Feel free to submit a support ticket directly from your RunCloud dashboard.