How to Install Plesk on CentOS via the Command Line

Posted on Updated on

Plesk is one of the major web based hosting platforms along with cPanel and a few others. Since cPanel only runs on Linux, most Windows servers run Plesk. However, Plesk can also run on Linux and if you have expertise with its interface, then it might make sense to capitalize that and install it on your Linux server instead of cPanel/WHM. This tutorial will show you how to get started with Plesk on CentOS from the command line.

Meeting the Requirements

The first thing to do is check whether or not your Linux box has enough memory. That means 10GB of free disk space, 512MB RAM and a 1GB swap file. The first two are pretty basic, but many new Linux systems might not have a swap file. You can take a look at the RAM usage of Linux by typing in:

free -m

Here’s a sample output from my Linux box:

You can see from this screenshot, that I have no swap file enabled. This means I’m going to have to create one with a size of at least 1GB.

Creating a Swap File in CentOS

1GB is 1024 MB. The first step is to multiply that by 1024. So we have:

1024 * 1024 = 1048576

Next, we type the following commands at the CLI:

dd if=/dev/zero of=/swapfile bs=1024 count=1048576
mkswap /swapfile
swapon /swapfile

The last part of the first line in bold ends with the number we got after the multiplication. Replace it with whatever number you ended up with if you want a swap file that’s more than 1GB. These will automatically create and enable the swap file. However, it’s not enabled at boot time. To do that, edit the /etc/fstab file using a text editor like vi:

vi /etc/fstab

And add the following line at the end:

/swapfile swap swap defaults 0 0

Save and exit. Now when you type “free -m”, we can see that the swap file has been added:

Now that we have a swap file, we’re ready to install Plesk on CentOS!

Steps to Install Plesk on CentOS

First, open up a temporary directory and download the Plesk installer like this:


Next, we give the script execution rights with:

chmod +x plesk-installer

And then we run it:


The first screen is the terms and conditions, etc etc,

Next, we choose the Plesk version to install. In this example, I choose the stable version. By default, the option with the star (*) next to it is chosen. To change the selection, enter the number of the option you want to choose and hit Enter. The location of the star will change, and you can then go ahead and press “F”.

Next, we choose the type of installation. I decide to go with the typical default:

Plesk will now do a scan of your system and find out which packages need to be downloaded or updated. It’ll present you with a summary and prompt you for confirmation:

Once you press “F”, the installation starts. It doesn’t take particularly long. A couple of minutes at the most. Finally, you’ll end up with a message saying “Congratulations”.

Logging in for the First Time

The first step is to log in for the first time and start the GUI process, setting the admin password etc. To do this, we need to generate a one-time login link. We get that by typing in the following command:

plesk bin admin --get-login-link

You can see below, that this generates a secure URL. Once we copy it and paste it into a browser, we can then complete the rest of the setup process via the GUI – including changing the admin password.

And that’s it! Setting up Plesk on CentOS is an extremely easy process. Most of the hard work is done for you automatically, and you just need to make sure that your system meets the requirements of the software.

Leave a Reply

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