Cart

/ Domain name

/ Your .CO.UK domain
for only £ 4.99**

Get started with your own domain names

Register now

/ Other

/ Latest news

Launch of new Big Storage platform

Read more
Need help?

    Sorry, we could not find any results for your search querry.

    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 AlmaLinux as the underlying operating system. By default, AlmaLinux 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 (they usually are on a new installation). 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 AlmaLinux

    You can update AlmaLinux 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 AlmaLinux are available, and install them directly with the command:

    dnf -y update

    Updating DirectAdmin

    DirectAdmin needs to be updated separately from AlmaLinux using the ‘custombuild’ process. This is a collection of scripts used to update and modify DirectAdmin's configuration.

     

    Step 1

    Connect to your VPS via the VPS console in your control panel or via SSH.


     

    Step 2

    Run the following commands:

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

     

    Step 3

    Check what new updates are available:

    ./build versions
    

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


     

    Step 4

    ./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 8.0 and 7.4 on your VPS. At the time of the last update of this article, 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.
       
    • We recommend not supporting PHP versions that no longer receive security updates on your VPS.

    Step 1

    Log in as root via the console in your control panel or using SSH.


     

    Step 2

    Execute the following commands:

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

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


     

    Step 2

    Next, process the changes as follows, this will take a while:

    ./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
    

    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 this article's last update comes with MariaDB 10.6. Should 10.7 be supported at the time of your reading this article, we'll show you how to update MariaDB to 10.7. 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.7
    ./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.7.


    DirectAdmin updaten

     

    Updating a new DirectAdmin installation is not necessary. If you want to update DirectAdmin at a later time, you can use the steps below.

     

    Step 1

    Connect to your DirectAdmin VPS using SSH or your VPS console.


     

    Step 2

    To update DirectAdmin, simply run the command below.

    /usr/local/directadmin/scripts/getDA.sh current

    'Current' can optionally be replaced by alpha, beta, or stable.


    Updating DirectAdmin's services

     

    If you aren't changing DirectAdmin's service settings such as changing PHP versions but instead would like to update all installed services/software, use the steps below:

     

    Step 1

    Connect to your DirectAdmin VPS using SSH or your VPS console.


     

    Step 2

    Updating DirectAdmin should be done through the custombuild script.

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

     

    Step 3

    You can check which updates are available using the command:

    ./build versions

    This command gives an overview of all the currently installed versions and possible updates.


     

    Step 4

    Install all pending updates using the command:

    ./build update_versions

    The custombuild command is a process that will compile and install updates. The update process can take some time.


     

    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.

     

    Was this article helpful?


    Provide feedback about this article

    Need help?

    Receive personal support from our supporters

    Contact us