Control panels

How to install DirectAdmin on AlmaLinux

Install DirectAdmin on an AlmaLinux VPS with the official setup script, then log in securely on port 2222 and lock down the admin panel.

BeginnerLinux server6 min read

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 at 203.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.

Bash
hostnamectl set-hostname server1.example.com
hostname -f

The 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:

Bash
dnf install -y bind-utils
dig +short server1.example.com

Update the system and install the tools the installer wants:

Bash
dnf update -y
dnf install -y wget tmux

DirectAdmin expects SELinux to be disabled or permissive. Check the current mode:

Bash
getenforce

Warning: 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.

Bash
setenforce 0
sed -i 's/^SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

Open the ports DirectAdmin needs in firewalld. Port 2222 is the control panel itself; 80 and 443 are for the websites you will host.

Bash
firewall-cmd --permanent --add-port=2222/tcp
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

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

Bash
tmux new -s da

Download the setup script and run it:

Bash
wget -O setup.sh https://download.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh

The 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:2222

The 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:

Bash
passwd admin

Then do three things before you host anything:

  1. 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.
  2. Create a second admin-level user for day-to-day work instead of sharing the admin account.
  3. Review the panel's own firewall and brute-force protection settings under the admin tools.

Check it works

Confirm the panel service is running:

Bash
systemctl status directadmin --no-pager

Check that the expected ports are listening:

Bash
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:2222 does not load. Either firewalld or a provider-level firewall is blocking 2222. Re-check the firewall-cmd rules 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 tmux or screen.
  • Services fail to start after install. Check journalctl -xe and ausearch -m avc -ts recent. SELinux in enforcing mode is the usual cause; set it to permissive as shown above and reboot.

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.