How To Install DirectAdmin On CentOS 7

How To Install DirectAdmin On CentOS 7

DirectAdmin Control Panel is an easy-to-use web-based control panel, which makes it easy to manage and host websites on the servers. You can manage your email accounts, websites, etc., from the DirectAdmin control panel. DirectAdmin panels offer features such as lightness, high performance, low license fees, etc.

Feature

  • Create and manage email addresses
  • Create and manage FTP user accounts
  • Manage DNS
  • View statistics
  • Manage FrontPage Extensions
  • Create and manage subdomains
  • Upload and manage file using a file manager
  • Manage MySQL Databases
  • Backup and restore site files and account data
  • Set up error pages
  • Set up directory password protection
  • Install SSL certificates, set up cron jobs, and other advanced tools

Operating System:-

Below is a list of operating systems that DirectAdmin supports.

OSVersion
CloudLinux / RHEL / CentOS7.x 64-bit, 8.x 64-bit
VzLinux / AlmaLinux8.x 64-bit
Debian9.x 64-bit, 10.x 64-bit, 11.x 64-bit
Ubuntu18.04 64-bit, 20.04 64-bit

Prerequisites

  • Fresh server with CentOS 7 operating system.
  • Access of Root user or another user with Sudo privileges.
  • A minimum of 1 GB RAM (2 GB is preferred) is required, with at least 2 GB of swap memory.
  • A minimum of 10 GB of free space is required.
  • Valid Client ID & License ID from DirectAdmin.

Set Hostname- fully qualified domain

DirectAdmin panel installation requires a fully qualified hostname on the server. Run the following command to set a fully qualified domain name.

sudo hostnamectl set-hostname server.domain.com

Replace the server.domain.com with your desired hostname.

Update the Server

You must update all repositories and packages on the server before you can install Panel. To do this, execute the following command.

sudo yum update -y

Install pre-required packages

There are some pre-required packages that are required before starting the panel installation. Run the following command to install the pre-required packages.

sudo yum install vim screen wget curl -y

Create the Swap file

To provide temporary storage space for the system when memory runs out, a swap file is created on a solid-state drive or hard drive.

  • In order to achieve better performance, a swap file must double the RAM size. Run the following command to check the RAM of the server.
sudo free -h
  • Allocate the free space for the swap file. For this tutorial, we are using CentOS 7 server with 2 GB of RAM, So we will create a swap file of 4 GB. Run the following command to allocate the Swap space.
sudo dd if=/dev/zero of=/swapfile count=4696 bs=1M

Change the value of the count as per your server’s RAM.

  • Change the Ownership of the Swap file with the following command.
sudo chown root:root /swapfile
  • To avoid any type of modification on a Swap file, change the permission of the swap file.
sudo chmod 0600 /swapfile
  • Run the following command to setup the Swap file.
sudo mkswap /swapfile
  • Now enable the Swap file with the following command.
sudo swapon /swapfile
  • As soon as swap has been enabled, it must be made permanent, or it will automatically be deleted after reboot. To make the swap permanent, we need to pass an entry into the /etc/fstab file.
vim /etc/fstab
  • Pass the following entry in the /etc/fstab file.
/swapfile swap swap defaults 0 0
  • Verify that the configuration we’ve made above is correct with the following command.
mount -a
  • Check the swap file with the following command.
sudo swapon -s
  • To make the Swap file more effective, we need to adjust the swappiness value. Run the following command to check the swappiness value.
cat /proc/sys/vm/swappiness
  • Use the following command to set swappiness to 10.
sudo sysctl vm.swappiness=10
  • Modify the /etc/sysctl.conf file to make the swappiness value permanent.
vim /etc/sysctl.conf
  • Pass the following entry in the /etc/sysctl.conf file.
vm.swappiness=10

Obtain the Trial License

Register an Account with DirectAdmin to obtain the Trial license. To create an account on the DirectAdmin click on the Register button.

Fill in all the required information and then click on the Submit button.

Now Log into the DirectAdmin Account with the details of the Account, which you will receive in the Mail. Click on the Trial option. Enter all the required information such as email, hostname, Operating System, server’s IP address, etc. Click on the Proceed button to obtain the Trial License.

Now copy and save the Trial License.

DirectAdmin Installation

In order to avoid interruptions, run the installation script in a screen session in order to run it in the background. The script will take approximately 10 to 15 minutes to install and configure the DirectAdmin panel on the server.

sudo screen

Now download and execute the installation script with the following command. Add the Trial key at the end of the command.

bash <(curl -LSs https://download.directadmin.com/setup.sh || curl -LSs https://download-alt.directadmin.com/setup.sh) 'Trial license key'

After the installation script got completed, you will get the login details for the Panels.

Login to DirectAdmin

Enter the following URL in the browser to log into the Panel.

http://server_ip:2222

Now you will land on the Homepage of the DirectAdmin panel as follows.

Conclusion

The Direct Admin control panel is not only simple and easy to use, but it has anti-crash capabilities as well, which ensures services remain stable. The speed of this control panel can be attributed to the effort put into designing it to be simple, beautiful, versatile, yet practical and professional at the same time.

After reading this article, I hope it has also solved the problems you were having with DirectAdmin’s installation. If you still encounter problems after reading this article, let me know in the comments section.