Cart Control panel
Article overview

Help article

DirectAdmin Tutorial Series 3: updating your VPS

This is the third part of our DirectAdmin Tutorial Series. If you are planning a new VPS, then we recommend starting with part 1 and to not skip any parts.

Our pre-installed version of DirectAdmin comes with CentOS as the underlying operating system. By default, CentOS 7 makes use of older versions of software (though with recent security updates) because it prefers stability over new features.

For that reason, not all software on your VPS is up-to-date. You can check the current versions on your VPS by clicking ‘Admin Level’> ‘Admin Tools’> ‘System Information’ in DirectAdmin. You will then see an overview as in the screenshot below.

DA system info

Especially CMS systems like WordPress often require newer versions of PHP and MySQL to function. It is therefore advisable to update your VPS.

  • Perform the steps in this article as root / sudo user.
  • If you use the steps below to update an existing (instead of new) VPS,  create a snapshot of your VPS first before you follow the steps below. That way you always have a snapshot to fall back on if it turns out that a change creates a problem.

Updating CentOS

You can update CentOS separately from your DirectAdmin installation. Connect to your VPS via the VPS console in your control panel or via SSH.

Then check if new updates for CentOS are available, and install them directly with the command:

yum update

When asked for permission, click 'y' followed by 'Enter' (alternatively use the command yum -y update). CentOS will now download and install all updates.

Updating DirectAdmin

DirectAdmin needs to be updated separately from CentOS from the ‘custombuild’ process. Connect to your VPS via the VPS console in your control panel or via SSH.

Step 1

Run the commands below using SSH or your VPS console:

cd /usr/local/directadmin/custombuild
./build update


Step 2

Check what new updates are available:

./build versions

This command displays an overview of currently installed and possible updates.


Step 3

./build update_versions

This will install any updates of software listed in the previous command. The custombuild-command is a process that compiles the software. This update process may take some time.

Updating PHP

In this section, we show you how to update your PHP. For this manual, we assume that you want to be able to use PHP 7.4 and 7.3 on your VPS. Older PHP versions no longer receive security updates.

  • These steps require at least 512MB of free RAM. You can for example use the top command to check if you have enough free RAM.
  • You can choose to support up to 4 PHP versions at the same time. Would you like to support one version? Configure it in php1_release and set the other phpX_release values to no. Would you like to support more versions? Then add php3_release and or php4_release.
  • At the time of this update, only PHP 7.2 and newer receive security updates. We recommend not supporting older versions on your VPS.

Step 1

Log in as root via the console in your control panel or using SSH. Execute the following commands:

cd /usr/local/directadmin/custombuild
./build update
./build set php1_release 7.4
./build set php2_release 7.3
./build set php1_mode php-fpm
./build set php2_mode php-fpm
./build set mod_ruid2 no

We adjust the primary version to 7.4. However, you are free to adjust this or the php2_release to another version.


Step 2

Next, process the changes as follows:

./build php n
./build rewrite_confs


Step 3

Apache should automatically restart after updating, but should this not happen, restart Apache manually:

systemctl restart httpd


/sbin/service httpd restart
Further on in these tutorials, we show you how to switch between these PHP versions in DirectAdmin.
Updating SQL

DirectAdmin uses MariaDB as MySQL server by default. Our image at the time of writing comes with MariaDB 10.3. Should 10.4 be supported at the time of your reading this article, we'll show you how to update MariaDB to 10.4. MariaDB largely corresponds to MySQL (see this page for similarities and differences). There are newer versions, but they are not officially supported by DirectAdmin at the time of writing.


Step 1

Log in via the console in the control panel or using SSH as root and execute the following commands:

cd /usr/local/directadmin/custombuild
./build set mariadb 10.4
./build set mysql_inst mariadb
./build set mysql_backup yes
./build update
./build mariadb

The ./build set mysql_backup yes option is optional: with a new VPS there is no database yet to be backed up, so you do not have to do this.


Step 2

After a mysql update you always have to compile PHP again with:

./build php n

Your MariaDB installation has now been updated to version 10.4.


Next to being safe, your VPS is now completely up to date and ready to link a domain. Click here to continue to Part 4: Linking domains and subdomains to learn how to link your (sub)domain to DirectAdmin.

Should you have any questions left regarding this article, do not hesitate to contact our support department. You can reach them via the ‘Contact Us’ button at the bottom of this page.

If you want to discuss this article with other users, please leave a message under 'Comments'.


Do you have a good idea?

Give us your idea! If it's popular we'll add it to the wishlist!

Has this article been helpful?

Create an account or log in to leave a rating.


Create an account or log in to be able to leave a comment.

Are you stuck?

Ask one of our specialists to assist you

Contact us