Prerequisites for DirectAdmin Installation
Your Ubuntu VPS needs specific requirements before starting. DirectAdmin works best on a fresh Ubuntu 20.04 or 22.04 installation with at least 1GB RAM and 10GB disk space.
You'll need root access and a clean server without conflicting control panels. If you're migrating from cPanel or Plesk, complete the removal process first.
Our migration tutorials cover panel transitions thoroughly.
Set up a valid hostname that resolves to your server IP. DirectAdmin requires proper DNS resolution for licensing and SSL certificate generation.
Download and Prepare DirectAdmin Installation Files
Connect to your Ubuntu VPS via SSH and update the system packages:
apt update && apt upgrade -y
apt install wget curl -y
Create a temporary directory for the installation files:
mkdir /root/directadmin-install
cd /root/directadmin-install
Download the DirectAdmin installer script. The official script handles dependencies and licensing automatically:
wget https://www.directadmin.com/setup.sh
chmod +x setup.sh
Have your DirectAdmin license ID and license key ready. These credentials come with your DirectAdmin purchase or trial license.
Configure System Hostname and Network Settings
DirectAdmin requires proper hostname configuration before installation. Set your server hostname:
hostnamectl set-hostname your-server.example.com
echo "127.0.0.1 your-server.example.com" >> /etc/hosts
Verify the hostname resolves correctly:
hostname -f
nslookup $(hostname -f)
Configure your server's primary IP address if using multiple interfaces. DirectAdmin binds to the primary interface by default.
Open required firewall ports:
ufw allow 2222/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 21/tcp
ufw allow 22/tcp
ufw enable
Install DirectAdmin on Ubuntu VPS Using Setup Script
Execute the installation script with your license credentials:
./setup.sh --uid=your-license-id --lid=your-license-key
The installer prompts for several configuration options. Choose these recommended settings:
- Apache version: Latest stable (2.4.x)
- PHP versions: 7.4 and 8.1 (both for compatibility)
- MySQL/MariaDB: MariaDB 10.6 or higher
- Mail server: Exim with SpamAssassin
- FTP server: ProFTPD with TLS support
Installation takes 30-60 minutes depending on server specs and selected components. The script compiles Apache, PHP, and other services from source code.
Monitor the installation output for errors. Common issues include insufficient disk space or network connectivity problems during package downloads.
Initial DirectAdmin Configuration and Admin Account
After installation completes, create your admin account:
/usr/local/directadmin/scripts/setup.sh admin
Set a strong password when prompted. This account has full server control including user management and system configuration.
Access DirectAdmin through your browser at https://your-server-ip:2222 or https://your-domain:2222. Accept the self-signed SSL certificate initially.
Complete the initial setup wizard:
- Configure server contact email
- Set default domain settings
- Configure automatic updates
- Enable security features
Test basic functionality by creating a test user account and domain.
Configure SSL Certificates and Security Settings
Replace the default self-signed certificate with a proper SSL certificate. Use Let's Encrypt for free SSL:
/usr/local/directadmin/scripts/letsencrypt.sh request_single your-domain.com 4096
Configure DirectAdmin's SSL settings in the admin panel:
- Navigate to Admin Tools → SSL Certificates
- Enable "Force SSL" for admin access
- Set automatic certificate renewal
- Configure HSTS headers
Harden the installation with security best practices. Proper firewall configuration prevents unauthorized access attempts.
Change the default DirectAdmin port from 2222 to a custom port in /usr/local/directadmin/conf/directadmin.conf:
port=8443
Restart DirectAdmin after configuration changes:
systemctl restart directadmin
Set Up Email Services and DNS Integration
Configure Exim mail server settings through DirectAdmin's admin interface. Navigate to Admin Tools → Mail Queue Administration.
Set up proper reverse DNS (PTR) records for email deliverability. Contact your hosting provider to configure PTR records for your server IP.
Configure SPF, DKIM, and DMARC records for domains. DirectAdmin includes built-in DKIM key generation:
/usr/local/directadmin/scripts/dkim_create.sh example.com
Test email functionality by sending messages between accounts. Email deliverability requires proper authentication records.
Configure DNS zones for hosted domains. DirectAdmin includes a built-in DNS server with zone templates.
Optimize Performance and Resource Limits
Tune Apache and PHP settings for your server specifications. Edit the Apache configuration through DirectAdmin or modify files directly:
/usr/local/directadmin/custombuild/configure/ap2/configure.apache
/usr/local/php74/lib/php.ini
Set appropriate resource limits in DirectAdmin's user templates:
- Bandwidth limits based on server capacity
- Disk quota per user account
- Database limits and connection pools
- Process limits to prevent resource abuse
Configure log rotation to manage disk space. DirectAdmin generates extensive logs that need regular cleanup:
/usr/local/directadmin/scripts/rotate_logs.sh
Monitor server resources through DirectAdmin's built-in statistics. Hostperl VPS hosting includes comprehensive monitoring and support for DirectAdmin installations.
Backup Configuration and Maintenance Tasks
Set up automated backups through DirectAdmin's backup system. Navigate to Admin Tools → Admin Backup/Transfer.
Configure backup schedules:
- Daily incremental backups for user data
- Weekly full system backups
- Monthly backup verification tests
- Remote backup storage setup
Create backup retention policies to manage storage. Keep daily backups for 7 days, weekly for 4 weeks, and monthly for 12 months.
Test backup restoration procedures regularly. Untested backups provide false security.
Schedule maintenance tasks through DirectAdmin's cron job interface. Essential tasks include log rotation, database optimization, and security updates.
Frequently Asked Questions
Can I install DirectAdmin on Ubuntu 24.04?
DirectAdmin officially supports Ubuntu 20.04 and 22.04. While Ubuntu 24.04 may work, stick to supported versions for production servers.
The installation script includes compatibility checks for supported distributions.
How much RAM does DirectAdmin require?
DirectAdmin needs minimum 1GB RAM, but 2GB or more is recommended for production use. Memory requirements increase with the number of hosted domains, email accounts, and concurrent users.
Can I change the DirectAdmin port after installation?
Yes, modify the port setting in /usr/local/directadmin/conf/directadmin.conf and restart the service. Update firewall rules to allow the new port and block the old port for security.
What happens if my DirectAdmin license expires?
DirectAdmin continues running but blocks administrative functions until license renewal. Plan license renewals in advance to avoid service interruptions.
How do I update DirectAdmin after installation?
Use the built-in update system through Admin Tools → CustomBuild 2.0. This handles DirectAdmin updates, Apache, PHP, and other component upgrades safely.

