Updating DirectAdmin

Update channels

DirectAdmin update channels are software release streams allowing DirectAdmin users to select how often they want to receive software updates.

There four update channels:

  • current - default update channel used by new DirectAdmin installations.
  • stable - update channel that delays all the releases compared to current update channel, some minor versions are skipped entirely.
  • beta - update channel also known as pre-releases or release candidates (RC). This channel receives same updates as current channel but a bit earlier.
  • alpha - bleeding edge code usually contains not yet finished features, this update channels can receive bug-fixes almost immediately after they are pushed.

Update channel that is being followed are stored in the main directadmin.conf file with key update_channel. It can be checked with:

$ /usr/local/directadmin/directadmin c | grep update_channel
update_channel=alpha
1
2

And changed with:

/usr/local/directadmin/directadmin set update_channel current
1

Automated update

There are few ways of doing automated DirectAdmin updates which are disabled by default.

  • CustomBuild can be set to cron auto update the services, and if you also use da_autoupdate=yes, CB will do it for you. However, automated CB updates aren't always recommended.

  • A simple cronjob that runs this command is likely safer, if you only want DirectAdmin to be auto-updated:

echo "action=update&value=program" >> /usr/local/directadmin/data/task.queue
1

Each night that the update is rejected, you'll get a note in your /var/log/directadmin/system.log.

Note: Pre-release and regular updates do not issue full config rewrites. If you need a template change, you must issue a full rewrite to get it:

/usr/local/directadmin/custombuild/build rewrite_confs
1

Manual update using GUI

Update can be triggered from the GUI in the Licensing / Updates section. If a new DirectAdmin version is available you will see an Update Directadmin button available.

Repos View

Manual update using CLI and helper script

Manual update can be triggered by a helper script getDA.sh. Script usage is straightforward:

$ /usr/local/directadmin/scripts/getDA.sh
Usage:
    /usr/local/directadmin/scripts/getDA.sh alpha
    /usr/local/directadmin/scripts/getDA.sh beta
    /usr/local/directadmin/scripts/getDA.sh current
    /usr/local/directadmin/scripts/getDA.sh stable
    /usr/local/directadmin/scripts/getDA.sh [commit-hash]
1
2
3
4
5
6
7

For example to manually update DirectAdmin to latest release in the current update channel use:

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

Please note that this is a manual update process, it will not start following new upate channel after update. An update from the dashboard will switch back to the latest release from the configured update channel.

Manual update using CLI commands

If helper script is not available (it is not present in very old DirectAdmin installations) or you want full control of update procedure DirectAdmin can be upgraded compltely manually.

Execute the following commands as root user:

CHANNEL=current                                                                                             # can be one of: alpha, beta, current, stable
OS_SLUG=linux_amd64                                                                                         # can be: linux_amd64, rhel8_amd64, rhel7_amd64, debian10_amd64, ...
COMMIT=$(dig +short -t txt "$CHANNEL-version.directadmin.com" | sed 's|.*commit=\([0-9a-f]*\).*|\1|')       # can be commit hash literal value if you want specific build to be installed
FILE="directadmin_${COMMIT}_${OS_SLUG}.tar.gz"                                                              # creates download package name from the variables above

curl --location --progress-bar --connect-timeout 10 "https://download.directadmin.com/${FILE}" --output "/root/${FILE}"   # downloads given directadmin build into /root dir
tar xzf "/root/${FILE}" -C /usr/local/directadmin                                                                         # extracts downloaded package to /usr/local/directadmin
/usr/local/directadmin/directadmin p || true                                                                              # runs post-upgrade permission fix step
/usr/local/directadmin/scripts/update.sh                                                                                  # runs other post upgrade fixes
echo 'action=directadmin&value=restart' >> /usr/local/directadmin/data/task.queue                                         # schedules directadmin to be restarted on next dataskq run
1
2
3
4
5
6
7
8
9
10

How to check latest available DirectAdmin version

In an attempt to be more efficient at allowing all DirectAdmin boxes to know which version is the most recent, we've added a new TXT records for each update channel:

  • alpha-version.directadmin.com
  • beta-version.directadmin.com
  • current-version.directadmin.com
  • stable-version.directadmin.com

Example of checking current versions using dig tool:

$ dig +short -t txt alpha-version.directadmin.com beta-version.directadmin.com current-version.directadmin.com stable-version.directadmin.com
"v=1.63.2&commit=00112233445566778899aabbccddeeff00000000"
"v=1.63.1&commit=aa112233445566778899aabbccddeeff00000000"
"v=1.63.1&commit=aa112233445566778899aabbccddeeff00000000"
"v=1.63.0&commit=ff112233445566778899aabbccddeeff00000000"
1
2
3
4
5

Extracting just the version string:

$ dig +short -t txt current-version.directadmin.com | sed 's|.*v=\([0-9.]*\).*|\1|'
1.63.1
1
2
Last Updated: 12/27/2021, 12:17:36 PM