How to install CentOS Web Panel in CentOS 7

centos

CentOS Web Panel (CWP) is a free web hosting panel for RPM-based distributions like CentOS, and provides an easy-to-use interface to manage your server. CWP comes with a huge variety of features/services, and unlike other control panels, it can automatically install a LAMP stack with a Varnish cache. Some of its other features include:

  • CSF firewall
  • File system lock
  • User management
  • DNS management
  • SSL generator
  • System & services monitoring
  • File manager
  • SQL services

In this tutorial, we will look at how to install CentOS Web Panel in CentOS 7 and configure some of its services once the installation is complete.

Prerequisites to install CentOS Web Panel

  • A new VPS running CentOS 7.
  • A DNS A record that points to your server’s IP address based on the FQDN you want to use. For example, an A record named test would point to test.DOMAIN.TLD.

Step 1. Install the CentOS Web Panel

Luckily for you, the installation of Centos Web Panel is pretty easy. Just download the installation script and run it. The script will automatically install all the required packages for CWP, and at the end of the installation, you will be provided with an URL to login to the panel.

On a freshly installed CentOS 7 system, wget is not available. Install it by issuing following command in the terminal:

$ sudo yum -y install wget

Next, update the system using yum and download the installation script. Make the script executable before running it.

$ sudo yum -y update
$ sudo wget http://centos-webpanel.com/cwp-el7-latest
$ sudo chmod u+x cwp-el7-latest
$ ./cwp-el7-latest

The installation script will take some time to complete, and once it’s done you will be provided with an URL to access the panel and your MySQL root password. Make sure you keep these details as you will need them at later stage:

#############################
#      CWP Installed        #
#############################

go to CentOS WebPanel Admin GUI at http://SERVER_IP:2030/

http://SERVER_IP:2030
SSL: https://SERVER_IP:2031
---------------------
Username: root
Password: PASSWORD
MySQL root Password: MYSQL_PASSWORD

#########################################################
          CentOS Web Panel MailServer Installer          
#########################################################
SSL Cert name (hostname): HOSTNAME.DOMAIN.TLD
SSL Cert file location /etc/pki/tls/ private|certs
#########################################################

visit for help: www.centos-webpanel.com
Write down login details and press ENTER for server reboot!
Press ENTER for server reboot!

Restart the server by pressing Enter key. Once the server boots up, access CWP from your favorite browser by entering either http://SERVER_IP:2030 or https://SERVER_IP:2031 into the address bar.

Login to the panel using system’s root account. You got the password in the previous step.

Once you logged in successfully, you will be redirected to the dashboard where you can find system stats, running processes, file system stats, disk details, service details, and more. There will be some warnings as well in orange and red colors.
To remove these warnings, set the root email first. Next, to enable the firewall, click the Firewall tab in the dashboard and start the firewall by clicking Enable firewall in the firewall manager section.

Step 2. Change the hostname

Before proceeding further, let’s edit the hostname by navigating to Server settings -> Change hostname from the left sidebar.

You can also allocate disk quotas, create cron jobs for users, or change the root password from the server settings menu.

Step 3. Add a user account

At this stage, you are ready to add domains, but for that, you need to have at least one user account. You must create a user account that belongs to yourself and link this main account to the domain to add your site in a personal hosting server.

Create a user account by navigating to User Accounts -> New Account from the left menu bar. Provide all the details like domain name, username, password, and so on. Optionally you can tick shell access and autoSSL features.

How to install CentOS Web Panel: creating a new user account

You will be provided with Account details and Panel URL for this new user.

Account Details
========================================
Server IP: SERVER_IP
Web Panel Login:
Domain: DOMAIN.TLD
Username: USERNAME
Password: PASSWORD
Admin Email: EMAIL@DOMAIN.TLD

Panel URL:
http://SERVER_IP:2082
https://SERVER_IP:2083

NameServers:
ns1.centos-webpanel.com
ns2.centos-webpanel.com

Login to the panel for this newly created user by using above information/credentials. Remember that the port number for accessing users panel are at 2082/2083 for http/https, respectively.

Step 4 (optional). Install Softaculous

Softaculous is a one-click script installer supported by most of the web panels.

To install it, Navigate to Script Installers->Scripts Manager and then click the Install Softaculous button. The installation process will take a minute or two.

Once the process is finished, you can configure Softaculous via Install Softaculous. You’ll be able to take advantage of nearly 500 installation scripts that will make managing your server easier than always diving into the terminal.

Step 5. Install a Let’s Encrypt certificate for SSL-enabled CWP

Let’s wrap up this article by fetching a Let’s Encrypt’s SSL certificate for the hostname where CWP has been installed.

Navigate to Apache Settings->SSL Cert Manager and look for the AutoSSL tab/section. Then enter the username you created in Step 3, followed by the hostname/domain you want to encrypt with SSL. Click the Install SSL button, and you should see a message confirming that it was installed successfully.

To finalize the SSL certificate installation, you need to edit the /usr/local/cwpsrv/conf/cwpsrv.conf configuration file. You can edit the file directly in CWP by navigating to File management -> Advanced File Manager. Find the file, click on it, and hit the edit button. In the second server section, comment the existing SSL directives—ssl_certificate … and ssl_certificate_key …—and add the following:

server {
  ...
  ...
  ssl_certificate /etc/pki/tls/certs/DOMAIN.TLD.cert;
  ssl_certificate_key /etc/pki/tls/private/DOMAIN.TLD.key;
  ...
  ...
}

Click the Save file button and close the CWP File Manager. Reboot the server by navigating to CWP Settings -> Reboot Server. Wait for few minutes, and you will be able to connect to CWP via https://DOMAIN.TLD:2087 OR https://DOMAIN.TLD:2031. You can check the Let’s Encrypt certificate information by clicking the green icon from the address bar.

How to install CentOS Web Panel: adding a Let's Encrypt SSL certificate

We’ve checked how to install CWP and configured few services offered by it. You can now explore other features and services in CWP wiki. If you are interested in hosting a domain on your CentOS VPS, then give CWP a try!