How to Install & Set Up DirectAdmin

Looking to join the DirectAdmin community? This post will guide you through the easy process of installing and configuring DirectAdmin on a Virtual Private Server (VPS) including some additional security tips and usage examples. This guide will take approximately 10-15 minutes to read through.

1 – Introduction to DirectAdmin

DirectAdmin is a long standing control panel for hosting and managing website projects with an abundance of features and an easy to use design. It’s becoming increasingly popular, particularly since the pricing for competing control panels was abruptly hit in 2019 (see cPanel, reference 19).

The team at DirectAdmin have worked extremely hard to get where they are and even harder since the new stream of customers providing suggestions arrived.

2 – Installation Requirements

To install DirectAdmin, you’ll need a Linux based server that meets the minimum requirements.

DirectAdmin officially supports the following Linux distributions:

For the purposes of this guide, we’ll be using AlmaLinux.

In terms of server specifications DirectAdmin recommends a processor running at least 500 Mhz if not more, and more cores will enable you to expand and run more processes. You’ll also need at least 1-2GB RAM and additional SWAP memory of 2GB+ if possible. In terms of storage you will need 2-10GB of free space and bare in mind your website files may also need additional storage.

It’s important that you don’t pre-install any applications like PHP, MySQL or Apache before running the DirectAdmin script, as it does it all for you.

Don’t forget, you’ll also need root access.

3 – Basic Security

When you install DirectAdmin using the automatic installer, it will pre-install the Config Server Firewall plugin which will whitelist your currently used ports. A security technique widely used is to change the SSH port away from the default value to make it harder for automatic attackers to brute force your machine. To change your port, edit the /etc/ssh/sshd_config file.

nano /etc/ssh/sshd_config

Find the line which includes #Port 22 and change it to the value you want it to be and remove the hashtag. Then restart the service.

service sshd restart

Make sure to confirm it’s worked by opening another terminal and trying the new details.

4 – Starting the Installation

1. Enter the following command to run the installer, inserting your license key where necessary.

bash <(curl -fsSL https://download.directadmin.com/setup.sh) 'Provided license key should go here'

5 – Accessing the Control Panel

The control panel is hosted on port 2222. You can access it by visiting youripaddress:2222 in your web browser. You can also point your domain name to the IP address to create a panel hostname.

Your admin login details were created during the installation are displayed within the terminal at the end. If you’re accidentally closed your terminal, not to worry as there is a log file stored of the entire installation process which contains your login information.

nano /usr/local/directadmin/scripts/setup.txt

OR

nano /usr/local/directadmin/conf/setup.txt

6 – Securing the Control Panel

You’ll need to secure your hostname. This can easily be done using Let’s Encrypt.

1. Change to the directory with the Let’s Encrypt script and run it for your hostname.

cd /usr/local/directadmin/scripts
./letsencrypt.sh request_single your.hostname.com 4096

2. Change to the main DirectAdmin directory and enable the SSL configuration. Then force SSL with your panel hostname and restart DirectAdmin.

cd /usr/local/directadmin
./directadmin set ssl 1
./directadmin set carootcert /usr/local/directadmin/conf/carootcert.pem
./directadmin set ssl_redirect_host your.hostname.com
service directadmin restart

7 – Administrator / Custombuild Settings

Custombuild is a tool built in to DirectAdmin that manages the installations and updates of several applications such as Apache, PHP, MySQL and Webmail. There are dozens of alternative applications and functions also included and it’s an extremely important part of managing a DirectAdmin server.

You can access the Custombuild directory at /usr/local/directadmin/custombuild – However, there is also a GUI version available within the control panel which will look something like this:

From within this page you can update software as new versions are released as well as change your software configuration, customise your settings, remove old software and build new software.

8 – Creating a Package and User Account

To create a user package navigate to “Manage User Packages” within the “Account Manager” and then select “Add Package“. You’ll be directed to a package creation screen where you can specify your resource assignments and package options.

To create a user account, navigate to “Add New User” within the “Account Manager” where you can enter the username, domain password and email address for the account you’d like to create as well as select from one of the packages that you’ve just created.

8 – Log File Locations and Conclusion

Log files are an important part of diagnosing an error as they will store the error messages received. To view recent logs, use the tail command with the log location.

DirectAdmin Logs:

/var/log/directadmin/error.log
/var/log/directadmin/errortaskq.log
/var/log/directadmin/system.log
/var/log/directadmin/security.log

Apache Logs:

/var/log/httpd/error_log
/var/log/httpd/access_log
/var/log/httpd/suexec_log
/var/log/httpd/fpexec_log
/var/log/httpd/domains/domain.com.error.log
/var/log/httpd/domains/domain.com.log
/var/log/messages (generic errors)

There are various other log files included with DirectAdmin that can be found here.

Thank you for reading this guide and I hope it’s given you a decent overview of the initial set up process of a DirectAdmin web hosting server.


This guide has been updated to reflect current standards while preserving the practicality of its original version, first archived in July 2020.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top