Set Up DirectAdmin on a Fresh VPS in 2026

What you are setting up
This guide shows you how to Set Up DirectAdmin on a Fresh VPS in 2026, starting with your first SSH login and ending with a working control panel you can hand off to a customer, agency client, or internal team. The steps cover a non-root admin account, package updates, firewall rules, DirectAdmin installation, licensing, and final checks on both Ubuntu/Debian and AlmaLinux/Rocky Linux.
If you are choosing infrastructure for a new panel deployment, a Hostperl VPS gives you a clean base for control-panel work, while agencies planning repeatable client launches can keep an eye on Hostperl's affiliate program for referral-based account growth.
Use these placeholders throughout the tutorial: SERVER_IP is your VPS address, DOMAIN_NAME is the hostname you will assign to the server, ADMIN_USER is your sudo user, and DA_LICENSE_KEY is your DirectAdmin license key. Example values: 203.0.113.10, panel.example.com, adminhost, and a license key issued by DirectAdmin.
Connect to the VPS and identify the operating system
Run the first SSH command from your local computer. Keep the root session open until you verify the new sudo user later.
ssh root@SERVER_IPIf your provider supplied a default non-root account, use that username instead of root.
ssh ubuntu@SERVER_IPOn the VPS as root, confirm the distribution before you install anything.
cat /etc/os-releaseYou should see either Ubuntu or Debian, or AlmaLinux/Rocky Linux. The package and firewall commands differ by family, so do not skip this check.
Create a non-root admin user before panel work
A panel install is cleaner when you manage it from a sudo account. Do this on the VPS as root, then open a second terminal and test the login before changing root access.
Ubuntu and Debian
adduser ADMIN_USER
usermod -aG sudo ADMIN_USER
mkdir -p /home/ADMIN_USER/.ssh
chmod 700 /home/ADMIN_USER/.ssh
cp /root/.ssh/authorized_keys /home/ADMIN_USER/.ssh/authorized_keys
chown -R ADMIN_USER:ADMIN_USER /home/ADMIN_USER/.ssh
chmod 600 /home/ADMIN_USER/.ssh/authorized_keysReplace ADMIN_USER with your login name. The final permissions should leave only the new account able to read its SSH key.
AlmaLinux and Rocky Linux
useradd -m ADMIN_USER
passwd ADMIN_USER
usermod -aG wheel ADMIN_USER
mkdir -p /home/ADMIN_USER/.ssh
chmod 700 /home/ADMIN_USER/.ssh
cp /root/.ssh/authorized_keys /home/ADMIN_USER/.ssh/authorized_keys
chown -R ADMIN_USER:ADMIN_USER /home/ADMIN_USER/.ssh
chmod 600 /home/ADMIN_USER/.ssh/authorized_keysOn the VPS as root, open a second terminal from your local computer and test the new user.
ssh ADMIN_USER@SERVER_IP
sudo -v
whoami
pwdYou want whoami to return the new user, and sudo -v should succeed without errors.
For a full walkthrough of this account handoff, Hostperl also documents the same safety sequence in Create a Non-Root Admin User on Ubuntu and AlmaLinux.
Update packages, time sync, and hostname
Now switch to the new sudo session. This is the right place to patch the base OS, set the hostname, and make sure time is correct before the panel installer runs.
Ubuntu and Debian
sudo apt update
sudo apt -y upgrade
sudo apt -y install curl wget gnupg ca-certificates chrony sudo ufw
sudo timedatectl set-timezone Pacific/Auckland
sudo hostnamectl set-hostname panel.example.com
sudo systemctl enable --now chrony
hostnamectl
chronyc trackingpanel.example.com is an example hostname. Use your own fully qualified domain name. The chronyc tracking output should show that NTP is synced or close to synced.
AlmaLinux and Rocky Linux
sudo dnf -y update
sudo dnf -y install curl wget chrony firewalld sudo policycoreutils-python-utils
sudo timedatectl set-timezone Pacific/Auckland
sudo hostnamectl set-hostname panel.example.com
sudo systemctl enable --now chronyd
hostnamectl
chronyc trackingOn RHEL-compatible systems, chronyd is the service name. DirectAdmin installers are less forgiving when time drift is large, especially on new VPS instances.
If your server will also host WordPress or ecommerce sites later, review WordPress Staging to Production Migration in 2026 so your deployment workflow and panel workflow stay aligned.
Open the firewall before the installer changes services
DirectAdmin needs SSH and web access at minimum. Add the new rules first, then keep your current root session open until the web panel is reachable.
Ubuntu and Debian with UFW
sudo ufw allow OpenSSH
sudo ufw allow 2222/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 2222
sudo ufw enable
sudo ufw status verboseUse port 2222 only if your DirectAdmin build or migration plan uses it. If you will keep SSH on port 22, remove the 2222 rule and keep OpenSSH only.
AlmaLinux and Rocky Linux with firewalld
sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --permanent --add-port=2222/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --list-allIf SELinux is enforcing, keep it that way. DirectAdmin and its services should be installed with SELinux-friendly settings rather than disabled globally. Check status now:
getenforceEnforcing is the expected result on AlmaLinux and Rocky Linux.
Install DirectAdmin with a clean hostname
DirectAdmin expects a valid FQDN and a reachable IP. Run the installer as root from the official script path. Replace the license key and email address with your own values.
sudo -i
cd /root
wget -O setup.sh https://www.directadmin.com/setup.sh
chmod 700 setup.sh
DA_LICENSE_KEY=YOUR_LICENSE_KEY bash setup.sh auto
after_install="done"The installer will prompt for package choices and network details on some systems. Use the hostname you set earlier. If you are migrating an existing account base, keep the root shell open until the installer finishes and the services are reported as started.
Once installation completes, access the panel using the URL shown by the installer, typically https://SERVER_IP:2222 or https://panel.example.com:2222. Log in with the admin credentials the installer provides or that your license setup uses.
Harden the panel after first login
Open DirectAdmin in a browser and change the admin password immediately. Then switch the access rules so the panel listens only on the ports you intend to support. For most small-business hosting setups, that means SSH, HTTP, and HTTPS remain open, while everything else stays closed until needed.
Set up the default admin account, confirm the server hostname, and create the first reseller or user package only after the license is valid. If you are managing multiple client sites, this is a good moment to map your migration queue and avoid live cutovers during peak traffic.
For mail-heavy clients, pair this setup with DMARC, SPF, and DKIM for Better Email Deliverability. Panel users often blame the web server for deliverability problems that actually start with DNS.
Check the services that matter most
Verify the panel, web stack, and firewall state from the server before you call the installation complete.
sudo systemctl status directadmin
sudo ss -tulpn | grep -E '(:2222|:80|:443)'
sudo journalctl -u directadmin -n 50 --no-pagerHealthy output should show DirectAdmin running, listening on the expected port, and no repeated startup errors in the logs. If Apache or Nginx is included in your build, check those service names too.
sudo systemctl status httpd
sudo systemctl status nginxOne of those may be inactive depending on your installation choice. That is normal as long as the service you selected is active.
Test from the browser and from the shell
From your local computer, open the panel URL and sign in. You should see the admin dashboard, server statistics, and account creation tools. If the browser warns about the certificate, that is expected until you attach a trusted TLS certificate to the hostname.
From the VPS, confirm the panel responds over HTTPS.
curl -kI https://127.0.0.1:2222
curl -kI https://SERVER_IP:2222You want an HTTP response such as 200, 302, or 401 depending on whether the endpoint expects authentication. The important part is that the connection works and the service answers.
Finish with TLS, backups, and reboot checks
After the panel is live, attach DNS and a trusted certificate to the hostname. If your domain is already pointing to the VPS, issue a Let’s Encrypt certificate from DirectAdmin or your web stack, then confirm the certificate chain in the browser. Keep your DNS records accurate, especially if you use multiple nameservers or separate mail routing.
If you want a deeper DNS and TLS checklist for customers, Hostperl's Technical SEO Audit for 2026: Crawlability, Schema, AI Search is useful because panel-hosted sites still depend on clean DNS and certificate hygiene for crawlability and trust.
Set a backup policy before you migrate any client data. A fresh DirectAdmin server is a good place to add nightly snapshots at the VPS layer and weekly off-server exports for accounts and databases.
sudo rebootAfter the reboot, reconnect and confirm persistence.
ssh ADMIN_USER@SERVER_IP
sudo systemctl status directadmin
sudo ss -tulpn | grep -E '(:2222|:80|:443)'
free -hYou should see DirectAdmin still active, the expected ports listening, and enough free memory for panel operations. On customer-facing hosts, that last check helps you spot undersized VPS plans before they become support tickets.
Troubleshooting the most common failures
The panel will not open in the browser
Run this on the VPS:
sudo systemctl status directadmin
sudo journalctl -u directadmin -n 100 --no-pager
sudo ss -tulpn | grep 2222If the service is stopped, start it with sudo systemctl start directadmin. If the port is missing, re-check the installer output and firewall rules.
SSH works but sudo fails
Run:
id ADMIN_USER
groups ADMIN_USER
sudo -lOn Ubuntu and Debian, the user must be in the sudo group. On AlmaLinux and Rocky Linux, the user must be in wheel. Add the user again if needed, then open a new session.
SELinux blocks a service on AlmaLinux or Rocky Linux
Check recent audit messages:
sudo ausearch -m AVC,USER_AVC -ts recent
sudo journalctl -t setroubleshoot --no-pager -n 50If you see denials tied to a panel service, prefer a targeted SELinux policy or package adjustment rather than disabling SELinux globally.
If you are provisioning new customer sites, Hostperl VPS plans give you a practical base for DirectAdmin, migrations, and day-two support. For teams that need stronger isolation or denser client hosting, compare Hostperl VPS with higher-capacity options before you commit the next batch of accounts.
That keeps the rollout predictable and gives you room to grow without rebuilding the control-panel stack a month later.
FAQ
Can I install DirectAdmin on a brand-new VPS?
Yes. That is the safest time to install it because there are no conflicting web stacks or old mail settings to untangle.
Should I use root for daily DirectAdmin work?
No. Use the sudo user you created for maintenance, then keep root only for installer and recovery tasks.
Do I need a domain name before installation?
You can install with an IP, but a real domain and hostname make SSL, mail, and browser trust much easier to manage.
What should I do before migrating existing sites?
Take a full backup, confirm DNS access, test the panel login, and plan a short cutover window so you can validate accounts after the move.
For direct help with hosting-panel planning, migrations, and launch readiness, Hostperl's support-led VPS environment is a better fit than a generic unmanaged server when you need someone to answer the operational questions that arrive after install.
