This is the third part of our DirectAdmin Tutorial Series. If you are setting up a new VPS, we recommend starting with part 1.
Our pre-installed version of DirectAdmin comes with AlmaLinux as the underlying operating system. When you install a new VPS with DirectAdmin, it will be up-to-date. However, DirectAdmin may choose to install a different version of software than you prefer, or you might want to update your server over time. In this section, we’ll show you how to update your DirectAdmin VPS.
You can check the current versions of most software on your VPS in DirectAdmin under 'System Info' > ‘System Information’ under 'Services'. You will see an overview like the one in the screenshot below.
Content management systems (CMS) like WordPress often require newer versions of PHP and MariaDB (MySQL) to function. It’s a good idea to regularly update your VPS.
- Execute the steps that describe command-line instructions as the root user.
- This is relatively complex material. If you are using the steps below to update an existing (instead of a new) VPS, always create a snapshot of your VPS before performing an update. This way, you have a snapshot to fall back on if a problem occurs after a change.
- Please note: at this time we offer legacy licenses which offer a better price to our customers. The disadvantage is that you may not be able to upgrade specific software to the latest version (the software offered is still secure and supported however). We will most likely offer the new (but more expensive) licenses that support the latest software versions in 2025.
Updating AlmaLinux
You update AlmaLinux separately from your DirectAdmin installation. Connect to your VPS via the VPS console in your control panel or via SSH.
Then check (as the root user or with sudo) whether new updates for AlmaLinux are available, and install them directly with the command:
dnf -y update
Updating DirectAdmin
There is a distinction between updating DirectAdmin itself and updating DirectAdmin services (e.g., MariaDB or PHP). You can update DirectAdmin itself as follows:
Updating from DirectAdmin
Step 1
Log in to DirectAdmin as an admin user and navigate to 'Support & Help' > 'Updates'.
Step 2
If updates are available, a ‘update directadmin’ button will be shown. If not, you will only be able to restart DirectAdmin here.
Click ‘restart directadmin’ after the update is completed to apply the updates.
Updating via Command-Line
Step 1
Connect to your DirectAdmin VPS via SSH or the VPS console.
Step 2
You update DirectAdmin with the following command:
/usr/local/directadmin/scripts/getDA.sh current
You can optionally replace 'current' with alpha, beta, or stable.
Updating DirectAdmin Services
If you don’t want to adjust specific versions of installed software (e.g., the PHP version), you can update all services/software at once from DirectAdmin or via the command-line using the ‘custombuild’ process. This is a collection of scripts for adjusting/updating the DirectAdmin configuration.
Updating from DirectAdmin
Step 1
Navigate in DirectAdmin to ‘Extra Features’ > ‘CustomBuild’.
Step 2
Click ‘Updates’ in the CustomBuild overview. When updates are available, the number will indicate how much software has updates available.
Step 3
If there are updates for installed software, click ‘update’ next to the respective software, or ‘update all’ to update all available software.
Updating via SSH
Step 1
Connect to your DirectAdmin VPS via SSH or the VPS console.
Step 2
Updating DirectAdmin services is done using the custombuild process.
cd /usr/local/directadmin/custombuild
./build update
Step 3
If you want to check for available updates first, execute the following commands:
./build versions
This command provides an overview of currently installed versions and possible available updates.
Step 4
You can then install all available updates with the command:
./build update_versions
The custombuild process compiles the software. The update process may take some time.
Adjusting and Updating PHP Versions
- You need at least 512MB of free RAM on your VPS for these steps. Check with the top command/process monitor in DirectAdmin to make sure you have enough free memory.
- You can choose to support between 1 and 9 PHP versions at the same time. Do you want to support one version? Set that in php1_release and set the other phpX_release values to no. To support more versions, use additional release options like php2_release, php3_release, etc.
- For security reasons, we recommend not supporting end-of-life versions of PHP on your VPS.
Adjusting PHP Versions from DirectAdmin
Step 1
Navigate in DirectAdmin to ‘Extra Features’ > ‘CustomBuild’.
Step 2
Click ‘Options’ in the CustomBuild overview.
Step 3
Adjust the available options as desired. By selecting different versions under the available phpX_release options, you enable the respective PHP version. You generally don’t need to adjust the phpX_mode options. Finally, click ‘Back’ in the upper right corner.
You will now return to the CustomBuild overview and see that updates are available. Follow the previously described process ‘Updating DirectAdmin Services’ to update/install the software.
Adjusting PHP Versions via Command-Line
Step 1
Log in via the console in the control panel or via SSH as root. Execute the following commands, where you are free to adjust the PHP version:
cd /usr/local/directadmin/custombuild
./build update
./build set php1_release 8.3
./build set php1_mode php-fpm
./build set mod_ruid2 no
Want to support more PHP versions? Add an extra phpX_release and phpX_mode for each version, for example:
cd /usr/local/directadmin/custombuild
./build update
./build set php1_release 8.3
./build set php1_mode php-fpm
./build set php2_release 8.2
./build set php2_mode php-fpm
./build set php3_release 8.1
./build set php3_mode php-fpm
./build set mod_ruid2 no
Step 2
Process the changes as follows (this will take some time):
./build php n
./build rewrite_confs
Step 3
Apache should automatically restart after updating, but if this doesn’t happen, restart Apache manually:
sudo systemctl restart httpd
Further along in these tutorials, we will show you how to switch between PHP versions in DirectAdmin.
Updating SQL
Our DirectAdmin installations use MariaDB (10.6) by default as the MySQL server. In this guide, we show you how to update MariaDB to a newer version if available at the time you are reading this article. MariaDB is largely compatible with MySQL (see this page for similarities and differences). There are newer versions, but at the time of writing, they are not yet officially supported by DirectAdmin.
DirectAdmin currently does not offer an option to update the MariaDB or MySQL version from the web interface.
Step 1
Log in via the console in the control panel or via SSH as root. Execute the following commands, replacing 10.6 with the desired MariaDB version:
cd /usr/local/directadmin/custombuild
./build set mariadb 10.6
./build set mysql_inst mariadb
./build set mysql_backup yes
./build update
./build mariadb
The option ./build set mysql_backup yes is optional: for a new VPS, there is no need for a database backup yet, so this is not necessary.
Step 2
After a MySQL update, you must always recompile PHP with:
./build php n
Your MariaDB installation is now updated to version 10.6.
Your VPS is now not only secure but also fully up-to-date and ready to link a domain. Click here to continue to Part 4: Linking Domains and Subdomains.
If you have any further questions after reading 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.