DirectAdmin is a commercial hosting control panel that you install on a server you own, and the vendor's setup script does most of the work. This guide takes a fresh AlmaLinux VPS from a bare root shell to a working DirectAdmin login on port 2222, with the licence, hostname and firewall checks done first so the installer does not fail halfway through.
Before you start
You need:
- A Linux VPS with root access and a clean AlmaLinux install. DirectAdmin expects a fresh server — no Apache, Nginx, MariaDB, Postfix or another control panel already running. If the server has been used before, reinstall the OS from your VPS provider's control panel and start again.
- A DirectAdmin licence key. Buy one from DirectAdmin and have the key ready. The licence is bound to the server's IP address, so the IP you register with the vendor must be the IP of this VPS.
- A fully qualified hostname, for example
server1.example.com, with an A record pointing at203.0.113.10. - An SSH session as root, and a terminal you can leave open for a while.
Check DirectAdmin's own install page for the currently supported AlmaLinux versions and the minimum RAM and disk requirements — those details change over time and the installer will refuse to run if the server is too small.
Set the hostname and prepare AlmaLinux
Set the hostname first. DirectAdmin builds its configuration around it, and changing it later means editing several files by hand.
hostnamectl set-hostname server1.example.com
hostname -fThe second command should print server1.example.com. If it prints something else, fix /etc/hosts so the hostname resolves locally before continuing.
Confirm the hostname resolves publicly to your server IP:
dnf install -y bind-utils
dig +short server1.example.comUpdate the system and install the tools the installer wants:
dnf update -y
dnf install -y wget tmuxDirectAdmin expects SELinux to be disabled or permissive. Check the current mode:
getenforceWarning: Changing SELinux can affect other services on the server. On a fresh VPS built only for DirectAdmin this is the expected setup, but do not change it on a server running other workloads.
setenforce 0
sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/configOpen the ports DirectAdmin needs in firewalld. Port 2222 is the control panel itself; 80 and 443 are for the websites you will host.
firewall-cmd --permanent --add-port=2222/tcp
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reloadIf you are still learning firewalld, the firewalld guide for AlmaLinux and Rocky covers zones and permanent rules in more detail.
Install DirectAdmin on AlmaLinux
Start a tmux session so the install survives a dropped SSH connection. This is the single most common cause of a broken DirectAdmin install.
tmux new -s daDownload the setup script and run it:
wget -O setup.sh https://download.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.shThe script asks for your licence key, your hostname and which network interface to use. Answer with the values you prepared above. It then compiles and configures the web server, PHP, the database server, the mail stack and the panel itself. Expect this to run for a long time; do not interrupt it and do not close the terminal.
Tip: Detach from tmux with Ctrl+B then D if you need to close your laptop. Reattach later with tmux attach -t da.
The setup script also supports an unattended auto mode for scripted builds. The exact variables and file layout change between releases, so read the vendor's install documentation before you rely on it.
When the script finishes, it prints the DirectAdmin admin username and a generated password. Copy both somewhere safe — the password is shown once.
Log in and secure the panel
Open the panel in a browser:
https://203.0.113.10:2222The certificate is self-signed at this point, so your browser will warn you. Accept the warning and log in with the credentials the installer printed.
If you lost the password, reset it from the shell. The DirectAdmin admin account is a normal system user, so passwd works:
passwd adminThen do three things before you host anything:
- In DirectAdmin, go to the SSL Certificates page at admin level and request a free Let's Encrypt certificate for
server1.example.com. This replaces the self-signed warning with a trusted certificate. - Create a second admin-level user for day-to-day work instead of sharing the
adminaccount. - Review the panel's own firewall and brute-force protection settings under the admin tools.
Check it works
Confirm the panel service is running:
systemctl status directadmin --no-pagerCheck that the expected ports are listening:
ss -lntp | grep -E ':(2222|80|443)\b'You should see directadmin on 2222 and the web server on 80 and 443. Finally, load https://203.0.113.10:2222 in a browser from outside your network and log in. If the login page loads and you can create a test domain, the install is complete.
Troubleshooting
- The installer rejects your licence key or reports an IP mismatch. DirectAdmin licences are tied to a specific IP. Check that the IP registered with the vendor matches the VPS, and that the licence has not expired. Reissue the licence from the vendor's client area if the IP changed.
- The script refuses to run because a control panel or web server is already installed. DirectAdmin needs a clean OS. Reinstall AlmaLinux from your VPS provider's control panel, then run the setup script again on the fresh system.
https://203.0.113.10:2222does not load. Either firewalld or a provider-level firewall is blocking 2222. Re-check thefirewall-cmdrules above and confirm the port is open in any external firewall.- The install fails partway through and the SSH session dropped. The script was killed mid-build. Reinstall the OS and run it again inside
tmuxorscreen. - Services fail to start after install. Check
journalctl -xeandausearch -m avc -ts recent. SELinux in enforcing mode is the usual cause; set it to permissive as shown above and reboot.
Next steps
- Lock down access properly with a non-root admin account: Create a sudo user on Ubuntu, Debian, AlmaLinux and Rocky Linux.
- Compare panel options before you commit: How to install cPanel & WHM on AlmaLinux 9 or 10 and How to install Plesk on a Linux VPS.
- Tune the web stack once the panel is live: Install Apache (httpd) on AlmaLinux and Rocky Linux.
