Install DirectAdmin on a VPS:requirements, commands and first steps
Install DirectAdmin on a VPS step by step: supported OS versions, 4 GB RAM and swap, the official setup command, firewall ports, Let's Encrypt and CustomBuild.

On this page
- Is a self-managed DirectAdmin VPS right for you?
- Requirements, checked against DirectAdmin's documentation
- Before you start
- Step 1: Connect and update the operating system
- Step 2: Set the hostname
- Step 3: Check memory and add swap if needed
- Step 4: Run the DirectAdmin installer
- Step 5: Log in and secure the admin account
- Step 6: Check the firewall
- Step 7: Create a package, a user and your first website
- Step 8: Turn on free SSL for each domain
- Step 9: Learn the CustomBuild basics
- Step 10: Backups, updates and email reputation
- Troubleshooting
- The one message worth forwarding
- Reader questions
- Sources & further reading
The short answer
Start with a fresh, supported OS such as AlmaLinux or Rocky Linux 9 or 10, Debian 13 or Ubuntu 24.04, at least 4 GB of RAM and 4 GB of swap, one static IPv4 address, root SSH and an Active, Verified licence. Set the hostname with a matching DNS record, run DirectAdmin's official setup.sh with your licence key, and log in on port 2222 with the details in setup.txt. Then check firewall ports, create a package and user, enable Let's Encrypt per domain, learn da build, and set up off-server backups.
Installing DirectAdmin on a VPS comes down to one command, once the groundwork is right. You need a fresh, supported Linux install (such as AlmaLinux or Rocky Linux 9 or 10, Debian 12 or 13, or Ubuntu 24.04), at least 4 GB of RAM plus 4 GB of swap, a static IPv4 address, root SSH access and an active DirectAdmin licence. Then you run DirectAdmin's official setup script with your licence key, log in on port 2222, and spend another half hour on firewall, SSL, backups and your first website. This guide walks through all of it, with the commands.
A made-up example of skipping the groundwork. Imran orders the cheapest VPS he can find, 2 GB of RAM and no swap, with an operating system image his provider still offers but that is close to end of life. The installer crawls for an hour, the database service gets killed for lack of memory, and the panel half works. He rebuilds the server twice before reading the requirements page. The third attempt, on a 4 GB server with swap and a current OS, finishes cleanly.
By the end you will have a working DirectAdmin server, a first site with HTTPS, and a checklist for keeping it healthy.
Is a self-managed DirectAdmin VPS right for you?
DirectAdmin gives you a full hosting control panel on your own server: websites, email, databases, DNS and backups for yourself or for clients. The trade-off is that you are now the system administrator. Security updates, backups, monitoring and fixing things at 2 am are your job, or your provider's if you buy a managed plan.
If you mostly want your website to run and do not want to look after a server, shared or managed hosting is usually the better fit. Our guide to what web hosting is compares the options.
Requirements, checked against DirectAdmin's documentation
DirectAdmin's system requirements page lists:
- Operating system: Red Hat Enterprise Linux and compatible distributions (CentOS Stream, Rocky Linux, AlmaLinux), Debian and Ubuntu, on 64-bit Intel/AMD or 64-bit ARM.
- Memory: a minimum of 4 GB of RAM, with at least 4 GB of swap.
- Disk: at least 2 GB free after the Linux install. That is the panel itself; your websites, mail, logs and backups need far more.
- Network: at least one static IPv4 address.
- System: SSH installed and working, root access, and a kernel and filesystem that support quotas.
- A clean install: DirectAdmin asks you not to install services such as Apache, PHP, MySQL, FTP or Sendmail beforehand. The installer sets these up itself.
DirectAdmin's operating system page lists the supported versions with end-of-life dates. At the time of writing:
- RHEL, AlmaLinux, Rocky Linux and CentOS 8, 9 and 10: OS end of life in May 2029, May 2032 and May 2035, with DirectAdmin support about three months longer.
- Debian 11, 12 and 13: Debian 11 reached its OS end of life in August 2026, with DirectAdmin support ending in November 2026, so do not start a new server on it. Debian 12 runs to June 2028 and Debian 13 to June 2030.
- Ubuntu 22.04, 24.04 and 26.04 LTS: OS end of life in April 2027, April 2029 and April 2031.
For a new server, choose a release with years left: AlmaLinux or Rocky Linux 9 or 10, Debian 13, or Ubuntu 24.04 or 26.04. CentOS Linux 7 and 8, the old favourites in many tutorials, are long past end of life.
Quick tip: the quota requirement can trip up container-based VPS products. If you are unsure whether your VPS supports filesystem quotas, ask the provider before you buy.
Before you start
- An active licence key. Sign in to your DirectAdmin client account and click view next to your licence. The documentation says the licence must show as Active and Verified before you install.
- A VPS that meets the requirements, freshly installed with your chosen OS and nothing else.
- A hostname on a domain you control, such as
server.example.com, with a DNSArecord pointing to the VPS's IPv4 address. The installer tries to issue a certificate for this hostname automatically, which only works if the DNS is in place. - Root SSH access, plus your provider's web console as a backup way in, in case a firewall rule locks you out.
- A snapshot or backup option from your provider, so you can return to a clean state.
- Your provider's firewall or security group settings, if it has one, so you can open the ports the panel needs.
Step 1: Connect and update the operating system
Log in as root over SSH, then bring the OS fully up to date.
On AlmaLinux, Rocky Linux or other RHEL-compatible systems:
dnf -y update
rebootOn Debian or Ubuntu:
apt update && apt -y upgrade
rebootReconnect after the reboot.
Step 2: Set the hostname
Set the server's hostname to the name you created the DNS record for:
hostnamectl set-hostname server.example.com
hostname -fThe second command should print the full name. Then check from your own computer that the DNS record works:
dig +short A server.example.comIt should return your VPS's IPv4 address. If not, fix the DNS record first and give it a little time.
Step 3: Check memory and add swap if needed
free -h
swapon --showIf you see less than 4 GB of swap, create a swap file. This example makes a 4 GB one:
fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstabRun free -h again to confirm the swap appears. The last line makes it permanent across reboots.
Step 4: Run the DirectAdmin installer
DirectAdmin's installation guide offers two ways. Both start the same script, downloaded from DirectAdmin's own server.
Option A: command line with your licence key
Replace the placeholder with your real key, keeping the single quotes:
sh <(curl -fsSL https://download.directadmin.com/setup.sh) 'YOUR_LICENSE_KEY'Option B: web-based installer
Run the script without a key:
sh <(curl -fsSL https://download.directadmin.com/setup.sh)It performs the initial system setup and then prints a URL to continue in your browser, in a form like http://your-server-ip:35222/?key=..., where you enter the licence key. If your provider has an external firewall, you may need to allow that port temporarily.
Optional: set details in advance
The installer accepts environment variables for common settings. DirectAdmin's predefined options page lists, among others, DA_HOSTNAME, DA_EMAIL, DA_NS1 and DA_NS2, DA_ADMIN_USER, and DA_CHANNEL (alpha, current or stable). For example:
export DA_HOSTNAME=server.example.com
export DA_EMAIL=you@example.com
export DA_NS1=ns1.example.com
export DA_NS2=ns2.example.com
sh <(curl -fsSL https://download.directadmin.com/setup.sh) 'YOUR_LICENSE_KEY'The same page shows the installer's default behaviour: unless told otherwise, it installs the CSF firewall, tries to issue a certificate for the server hostname using ACME, and disables insecure PHP functions. Leave those defaults on unless you have a specific reason.
The install compiles and configures a lot of software, so expect it to take a while. Keep the SSH session open until it finishes, and do not run the script a second time over a half-finished install without reading the error first.
Step 5: Log in and secure the admin account
When the installer finishes, it shows the admin login details. DirectAdmin also saves them in a file on the server:
cat /usr/local/directadmin/conf/setup.txtOpen the panel at http://your-server-ip:2222, or https://server.example.com:2222 once the hostname certificate is issued. Log in as the admin user, then straight away:
- Change the admin password to a long, unique one stored in a password manager.
- Turn on two-step authentication for the admin account if your version offers it.
- Protect the setup file. Once you have stored the details safely, delete
setup.txtor restrict it, since it holds the original credentials.
Step 6: Check the firewall
DirectAdmin's firewall documentation lists the ports a typical server needs open:
- 20, 21: FTP
- 22: SSH
- 25, 465, 587: outgoing and incoming mail (Exim)
- 53: DNS (named)
- 80, 443: websites
- 110, 143, 993, 995: mailboxes (Dovecot)
- 2222: the DirectAdmin panel
- 3306: MySQL, only if remote database access is needed
DirectAdmin recommends running a firewall and has direct integration with CSF. Check both layers: the firewall on the server, and any firewall or security group in your provider's control panel. Close ports for services you do not use, such as FTP if you only use SFTP.
Step 7: Create a package, a user and your first website
DirectAdmin has three levels: Admin (the whole server), Reseller (manages clients) and User (owns websites). Even if you are the only person using the server, put your websites in a normal user account rather than running them as admin.
- Create a package at Admin or Reseller level: a template of limits such as disk space, bandwidth, domains, email accounts and databases.
- Create a user with that package, giving the main domain, a username, an email address and a password. Menu names vary a little between DirectAdmin versions and skins; in current versions, look under the account manager section.
- Log in as the user (or use the admin's "login as" option) and check the domain appears under the user's domain setup.
Then point the domain at the server. Either set the domain's A records at your current DNS provider to the server's IP, or use the server's own nameservers if you set them up. Our guide on connecting a domain to hosting covers both methods, and our branded nameserver guide explains glue records if you want ns1.yourdomain.com.
Step 8: Turn on free SSL for each domain
Once the domain resolves to the server, issue a Let's Encrypt certificate at User level:
- Log in as the user and open SSL Certificates.
- Choose the option for an automatic certificate from an ACME provider (Let's Encrypt or ZeroSSL).
- Select the names to include: the domain,
www, andmailif you use mail on this server. - Save. DirectAdmin's documentation says certificates are then issued and renewed automatically, checked once every 24 hours.
The domain's DNS must point to the server first, or validation fails. DirectAdmin also applies a weekly request limit to stay within Let's Encrypt's rate limits, so do not hammer the button if something is wrong; fix DNS and try again.
Then make sure the site redirects HTTP to HTTPS, as our HTTPS redirect guide explains.
Step 9: Learn the CustomBuild basics
CustomBuild is DirectAdmin's tool for managing the web server, PHP, mail, database and related software. You can use it from the panel or from the command line with da build:
da build versions
da build set php1_release 8.3
da build php
da build rewrite_confsda build versions shows installed software and available updates. The set command changes an option in /usr/local/directadmin/custombuild/options.conf (here, the main PHP version), da build php rebuilds PHP with it, and rewrite_confs regenerates the web server configuration. Run da build help to see everything it can do, and test your sites after any rebuild.
Step 10: Backups, updates and email reputation
- Backups: set up scheduled backups of all users to a location off the server, using DirectAdmin's admin backup tools or your own system, and test a restore. Provider snapshots are a useful extra but not a replacement.
- Updates: apply OS security updates regularly (
dnf updateorapt upgrade), and keep DirectAdmin and the CustomBuild software current. Checkda build versionsafter updates. - Email: if the server will send email, ask your provider to set reverse DNS (PTR) for the IP to your hostname, and publish SPF, DKIM and DMARC records for each domain, as our email authentication guide explains. Some VPS providers block outgoing port 25 by default, so check before you promise clients working email.
- Monitoring: keep an eye on disk space, memory and the mail queue. A full disk is one of the commonest ways for a small server to fall over.
Troubleshooting
The installer says the licence is invalid
Check in your DirectAdmin client account that the licence is Active and Verified, and that you copied the key exactly, inside single quotes. Contact DirectAdmin if the status looks wrong.
The install fails or services are killed partway through
Usually not enough memory. Confirm 4 GB of RAM and 4 GB of swap with free -h. Start again from a fresh OS install (your snapshot) rather than repeatedly re-running the script on a broken one.
The installer complains about quotas
The VPS kernel or filesystem does not support quotas, which DirectAdmin requires. Ask your provider whether quotas can be enabled, or use a VPS type that supports them.
I cannot open port 2222 in the browser
A firewall is blocking it: on the server, at the provider, or both. Use your provider's web console to check the server firewall, and open TCP 2222 in any provider security group.
The hostname certificate was not issued
The hostname's DNS record was missing or wrong at install time, or port 80 was blocked. Fix the DNS record, open ports 80 and 443, and request the hostname certificate again from the panel.
Let's Encrypt fails for a user's domain
The domain does not yet point to this server, or a CAA record does not allow the certificate authority. Check with dig +short A example.com and dig +short CAA example.com, then try again after DNS updates.
I locked myself out with the firewall
Log in through your provider's web console, which does not depend on SSH, and allow your IP address again (with CSF, csf -a your.ip.address), or temporarily stop the firewall to regain access.
The one message worth forwarding
If someone else is setting up the server, send them this:
"Please install DirectAdmin on a fresh AlmaLinux 9 or 10, Debian 13 or Ubuntu 24.04 VPS with at least 4 GB RAM and 4 GB swap, using the official setup script and our licence key. Set the hostname to server.example.com with a matching A record and reverse DNS, keep CSF enabled, open only the ports we need, enable Let's Encrypt for all domains, and set up daily off-server backups with a tested restore."
The takeaway: meet the requirements first, start from a clean supported OS, run the official script with your licence key, then lock down the panel, firewall, SSL and backups before you host anything real.
Reader questions
Which operating system should I use for DirectAdmin?
DirectAdmin supports RHEL-compatible systems such as AlmaLinux and Rocky Linux 8 to 10, Debian 11 to 13 and Ubuntu 22.04 to 26.04. For a new server pick one with years of support left, such as AlmaLinux 9 or 10, Debian 13 or Ubuntu 24.04.
How much RAM does DirectAdmin need?
DirectAdmin's requirements list a minimum of 4 GB of RAM and at least 4 GB of swap. Busy sites, mail and databases need more.
What is the DirectAdmin install command?
Run sh <(curl -fsSL https://download.directadmin.com/setup.sh) 'YOUR_LICENSE_KEY' as root on a clean server, or run it without a key to continue in the web-based installer.
Where do I find the DirectAdmin admin password after installing?
The installer prints it at the end, and DirectAdmin saves the administrator credentials in /usr/local/directadmin/conf/setup.txt. Change the password after your first login.
Which ports does DirectAdmin need open?
Its firewall docs list 20 and 21 for FTP, 22 for SSH, 25, 465 and 587 for mail, 53 for DNS, 80 and 443 for websites, 110, 143, 993 and 995 for mailboxes, 2222 for the panel, and 3306 only if needed.
How do I get free SSL in DirectAdmin?
Point the domain at the server, then at User level open SSL Certificates, choose an automatic ACME certificate from Let's Encrypt or ZeroSSL and select the names to cover. DirectAdmin renews it automatically.
Can I install DirectAdmin on CentOS 7?
Not for a new server. CentOS Linux 7 and 8 are past end of life. Use a currently supported release from DirectAdmin's operating system list.
Sources & further reading
Originally published . About our editorial updates.


