DirectAdmin

Update DirectAdmin and server software with CustomBuild

Use CustomBuild in DirectAdmin to update Apache, Nginx, LiteSpeed, PHP, MariaDB, Exim and Dovecot, install extra PHP versions and keep DirectAdmin itself current.

AdvancedDirectAdmin admin2 min read

CustomBuild is DirectAdmin's tool for installing and updating the server software stack: web server, PHP, database, mail server, FTP and more. It is available both in the panel and on the command line. Regular CustomBuild updates are essential for security on any DirectAdmin server.

Before you start

  • Admin access to DirectAdmin and root SSH access to the server.
  • A recent backup or VPS snapshot before major changes such as a web server switch or MariaDB upgrade.

Update DirectAdmin itself

DirectAdmin updates automatically on most installations through its update channel. To check or trigger it manually, go to Admin Level → Licence / Updates (or Server Manager → Licence) and click Update DirectAdmin, or run as root:

da update

Update software in the panel

  1. Go to Server Manager → Plugin Manager if CustomBuild is not visible, and make sure the CustomBuild plugin is installed (it is by default).
  2. Open Server Manager → CustomBuild.
  3. Click Update software (or Update data first to refresh version lists).
  4. The Software updates list shows each package with the installed and available version. Click Update next to an item, or Update all.
  5. Watch the output window until it finishes.

Update from the command line

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

Then update everything that is outdated:

./build update_versions

Add or change PHP versions

  1. In CustomBuild → Edit Options, set php1_release, php2_release, php3_release and so on to the versions you want (for example 8.3, 8.2, 8.1).
  2. Set php1_mode to php-fpm for the best isolation and performance (or lsphp with LiteSpeed).
  3. Save and click Build PHP, or run ./build php.
  4. Rewrite web server configs with ./build rewrite_confs.

Users can then choose a version per domain; see switch PHP version per domain.

Change the web server

In Edit Options, the webserver option chooses between apache, nginx, nginx_apache (Nginx proxy in front of Apache) and litespeed or openlitespeed. After changing it, run ./build update, ./build all d and ./build rewrite_confs. Test thoroughly, because .htaccess behaviour differs under pure Nginx.

Useful CustomBuild commands

CommandWhat it does
./build versionsShow installed vs. available versions
./build update_versionsUpdate all outdated software
./build php nRebuild PHP versions
./build rewrite_confsRegenerate web server configuration
./build letsencryptUpdate the Let's Encrypt client

Troubleshooting

  • Build fails with compiler errors: install OS updates first (dnf update or apt upgrade) and run ./build update again.
  • Web server will not start after update: run ./build rewrite_confs and check the error log, for example /var/log/httpd/error_log.
  • Old PHP still selected for a site: the user's domain is set to that version; change it in the domain's PHP selector.
  • Disk full during build: clean /usr/local/directadmin/custombuild with ./build clean.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.