To use DirectAdmin on a Linux server, install it on a supported distro, complete the post‑install wizard, create hosting packages and user accounts, add domains, configure DNS and SSL, set up email, and schedule backups.
Secure the stack with CSF/ModSecurity, enable two‑factor authentication, and keep services updated via CustomBuild for stability and performance.
Learning how to use DirectAdmin on Linux server environments is easier than you think. DirectAdmin is a lightweight, fast web hosting control panel that lets you manage websites, domains, email, databases, and security from a clean interface.
In this beginner friendly guide, I’ll walk you through installation, first time setup, daily operations, hardening, updates, and troubleshooting based on 12+ years of hands on hosting experience.
What is DirectAdmin and How it’s Structured?
DirectAdmin is a commercial web hosting control panel for Linux. It’s prized for speed, simplicity, and a long track record of stability. It organizes tasks into three levels:
- Admin Level: server‑wide configuration (services, packages, system settings, backups).
- Reseller Level: create and manage plans, users, and resources.
- User Level: manage websites, domains, DNS, SSL, email, files, databases, and apps.
Requirements and Best‑Practice Prerequisites
Before installing DirectAdmin, prepare a clean supported Linux server with a valid license (Client ID and License ID). A VPS or dedicated server works best.
- Supported OS (check the latest list on DirectAdmin’s site): AlmaLinux/Rocky Linux 8/9, CentOS 7 (EOL—avoid for new), Debian 10/11/12, Ubuntu LTS (20.04/22.04).
- Minimum hardware: 2 vCPU, 2–4 GB RAM (8 GB+ recommended for multiple sites), 40 GB+ SSD, swap enabled on low‑RAM VMs.
- FQDN hostname (e.g., server.example.com) and a clean public IP.
- Open ports on firewall: 22 (SSH), 80/443 (web), 2222 (DirectAdmin), 53 TCP/UDP (DNS), 21 (FTP), mail: 25/465/587 (SMTP), 110/995 (POP3), 143/993 (IMAP).
- SELinux disabled or permissive for simplicity on first setup (harden later).
Install DirectAdmin on Linux (Step‑by‑Step Guide)
Log in as root over SSH and follow the steps for your distro. Keep your Client ID and License ID ready.
# 1) Set hostname (replace with your FQDN)
hostnamectl set-hostname server.example.com
# 2) Update the OS and install essentials
# RHEL/Alma/Rocky:
dnf -y update
dnf -y install wget curl perl tar unzip
# Debian/Ubuntu:
apt update && apt -y upgrade
apt -y install wget curl perl tar unzip
# 3) Download and run the DirectAdmin installer
cd /root
wget -O setup.sh https://www.directadmin.com/setup.sh
chmod 755 setup.sh
./setup.sh auto
# The installer will prompt for Client ID, License ID, OS, services, and options.
# 4) After install, note the admin login and go to: https://your-server-ip:2222
If your firewall is active (firewalld or UFW), allow the required ports. Example for 2222 and web ports:
# firewalld (RHEL family)
firewall-cmd --permanent --add-port=2222/tcp
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
# UFW (Ubuntu/Debian)
ufw allow 2222/tcp
ufw allow http
ufw allow https
First Login and Interface Overview
Visit https://your-server-ip:2222 and sign in with the “admin” credentials provided during installation. You’ll see the modern skin with three functional levels:
- Admin Level: Server Manager (services, DNS admin), Admin Tools (Service Monitor, Brute Force Monitor), Admin Backup/Transfer, CustomBuild.
- Reseller Level: Packages, Create/Modify Users, IP Management.
- User Level: Domain Setup, File Manager, SSL Certificates, E‑Mail Manager, Databases, PHP/Version Selector, Backups.
Essential Post‑Install Configuration
Step 1. Set Nameservers and DNS Templates
At Admin Level, define two nameservers (e.g., ns1.example.com and ns2.example.com) and glue them at your domain registrar. Adjust the DNS template if you prefer A records for the root domain and “www” CNAME.
Step 2. Secure the Hostname with SSL
Enable Let’s Encrypt for the server hostname so the DirectAdmin panel runs over HTTPS without browser warnings.
Step 3. Select Web Stack and PHP Versions (CustomBuild)
DirectAdmin’s CustomBuild lets you choose Apache, Nginx (reverse proxy or standalone), or OpenLiteSpeed, and multiple PHP versions with PHP‑FPM. Update and apply changes via shell:
cd /usr/local/directadmin/custombuild
./build update
# Example: choose Apache + Nginx reverse proxy and PHP versions
./build set webserver apache
./build set nginx yes
./build set php1_release 8.2
./build set php2_release 8.1
./build all d
./build rewrite_confs
Step 4. Mail Authentication (SPF, DKIM, DMARC)
Enable DKIM in DirectAdmin, ensure SPF is in each domain’s DNS zone, and add a DMARC record. This improves deliverability and reduces spam flags.
Step 5. Timezone, Backups, and Notifications
Set the server timezone, configure Admin Backup/Transfer with scheduled daily or weekly jobs, and enable email notifications for resource limits and brute force alerts.
Create Packages, Users, and Add Domains
At Reseller Level, create hosting packages with clear limits (disk, bandwidth, inodes, email accounts, databases). Then create a User and assign a package. At User Level, add the domain, select PHP version, and toggle SSL support.
- Subdomains and Aliases: Add subdomains for apps or staging. Use domain pointers for parked domains.
- File Manager and SFTP: Upload site files to the domain’s public_html or use SFTP for secure transfers.
- Databases: Create MySQL/MariaDB databases and access phpMyAdmin from the panel.
Enable Free SSL (Let’s Encrypt) for Websites
At User Level > SSL Certificates, choose Let’s Encrypt and select the domain and aliases (www, mail, webmail). Ensure DNS points to the server before issuing. Auto‑renewal is handled by cron.
Email Setup and Best Practices
DirectAdmin uses Exim (SMTP) and Dovecot (IMAP/POP3). Create mailboxes at User Level > E‑Mail Accounts, and access webmail via /webmail (Roundcube).
- Use SMTP ports 465 (SSL) or 587 (Submission), and IMAP 993/POP3 995.
- Add SPF, DKIM, and DMARC records to each domain zone.
- Set sensible rate limits to prevent abuse.
- For transactional email, consider a relay (e.g., SMTP provider) to improve inbox placement.
Backups and Safe Restores
Use Admin Backup/Transfer for full or selective backups (users, DNS, databases, email). Store backups locally and sync off‑server via SFTP or remote FTP. Schedule incremental or rotating backups and test restores regularly.
Security Hardening Checklist
- Two‑Factor Auth (2FA): Enable 2FA for Admin, Resellers, and Users.
- CSF + LFD: Install ConfigServer Firewall and enable Login Failure Daemon to block brute force attempts.
- ModSecurity WAF: Deploy ModSecurity with a quality ruleset and tune false positives.
- Brute Force Monitor: Configure thresholds and auto‑block policies inside DirectAdmin.
- SSH Hardening: Change SSH port, disable root login, use key‑based authentication.
- PHP Harden: Use PHP‑FPM per user, enable open_basedir, and disable dangerous functions where possible.
- Malware Scans: Schedule ClamAV or a commercial scanner for user directories.
- Kernel and Packages: Keep the OS patched; reboot when kernels update.
# ModSecurity deployment via CustomBuild
cd /usr/local/directadmin/custombuild
./build update
./build modsecurity yes
./build modsecurity_rules
./build rewrite_confs
Updates, Maintenance, and CustomBuild Commands
DirectAdmin and its service stack should be updated regularly. CustomBuild simplifies this process and helps you stay secure.
# Update CustomBuild and software
cd /usr/local/directadmin/custombuild
./build update
./build versions # review available updates
./build update_da # update DirectAdmin itself
./build php n # rebuild PHP with current options
./build all d # rebuild and restart needed services
./build rewrite_confs # ensure configuration files are consistent
Pro tip: After major updates, verify web, mail, DNS, and database services, then test a site and send a test email to confirm deliverability.
Troubleshooting: Logs and Quick Fixes
- DirectAdmin log: /var/log/directadmin/error.log
- Apache/Nginx: /var/log/httpd/error_log or /var/log/nginx/error.log
- PHP‑FPM: /var/log/php-fpm/error.log (path may vary)
- Exim (SMTP): /var/log/exim/mainlog
- Dovecot (IMAP/POP3): /var/log/maillog or /var/log/dovecot.log
- DNS (named): /var/log/messages or journalctl -u named
# Rebuild configs if changes don't apply
cd /usr/local/directadmin/custombuild
./build rewrite_confs
# Restart common services (examples)
systemctl restart directadmin
systemctl restart httpd || systemctl restart apache2
systemctl restart nginx
systemctl restart php-fpm
systemctl restart exim dovecot named
# Fix common permission issues (use with care, target a specific user if possible)
# DirectAdmin provides scripts; review docs before running on production.
Performance Tips for Faster Sites
- Choose the right stack: Nginx reverse proxy with Apache is balanced; OpenLiteSpeed is great for high concurrency.
- Enable PHP‑FPM and OPcache for each PHP version.
- Use HTTP/2 (and HTTP/3/QUIC if your stack supports it).
- Cache wisely: app‑level caching (WordPress plugins) + server caching where applicable.
- Tune MariaDB: set innodb_buffer_pool_size ~50–70% of RAM on DB‑heavy servers.
- Compress assets (Gzip/Brotli), and enable image/WebP optimization.
Migrating and When to Choose DirectAdmin vs cPanel
DirectAdmin is ideal if you want a lightweight, cost‑effective panel with clear separation between Admin/Reseller/User levels and an easy learning curve. Migration tools can import cPanel backups, and most stacks (Apache/Nginx/PHP‑FPM/MariaDB) map cleanly.
- Pros vs cPanel: generally lower resource usage and licensing cost; fast UI; flexible stacks.
- Considerations: Smaller plugin ecosystem; some advanced features require shell familiarity.
If you prefer a ready‑to‑use environment, YouStable offers SSD‑powered VPS and Dedicated Servers with DirectAdmin pre‑installed, hardened, and monitored—so you can focus on your websites instead of server plumbing.
Quick Start Checklist
- Install DirectAdmin, set a valid hostname, and open required ports.
- Pick your web stack and PHP versions via CustomBuild.
- Set nameservers, configure DNS templates, and issue Let’s Encrypt.
- Create packages, users, and add domains.
- Set up email with SPF/DKIM/DMARC.
- Schedule backups and test a restore.
- Harden with 2FA, CSF/LFD, ModSecurity, and SSH hardening.
- Update regularly and monitor service health.
FAQ’s
Which Linux distributions are best for DirectAdmin?
AlmaLinux and Rocky Linux 8/9 are the most common choices for production. Debian 11/12 and Ubuntu 22.04 LTS also work well. Avoid EOL systems. Always confirm support on the official DirectAdmin documentation before provisioning.
How do I access DirectAdmin after installation?
Open https://your-server-ip:2222 in your browser and log in with the admin credentials shown at the end of installation. If you secured a hostname with DNS, use https://server.example.com:2222 for a trusted SSL connection.
How do I enable free SSL for my websites?
At User Level, go to SSL Certificates, select Let’s Encrypt, tick your domain and aliases (www, mail), and issue. Ensure DNS records point to the server first. Renewals run automatically via cron.
Can I migrate from cPanel to DirectAdmin?
Yes. DirectAdmin provides tools to import cPanel backups (per‑account). Validate DNS, PHP versions, email routing, and .htaccess rules after migration. For complex stacks, test on a staging server before switching DNS.
How do I keep DirectAdmin and services up to date?
Use CustomBuild: update, review versions, then apply updates. Example: ./build update, ./build versions, ./build update_da, ./build all d, and ./build rewrite_confs. Always back up and schedule a maintenance window for major upgrades.
With these steps, you can confidently install, configure, and operate DirectAdmin on your Linux server, delivering fast, secure, and scalable hosting. If you want a fully optimized environment from day one, consider YouStable’s DirectAdmin servers with proactive monitoring, backups, and support.