{"id":48213,"date":"2018-02-20T12:50:03","date_gmt":"2018-02-20T18:50:03","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=48213"},"modified":"2018-02-20T12:50:03","modified_gmt":"2018-02-20T18:50:03","slug":"getting-started-with-cpanel-whm-on-microsoft-azure","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/getting-started-with-cpanel-whm-on-microsoft-azure\/","title":{"rendered":"Getting started with cPanel & WHM on Microsoft Azure"},"content":{"rendered":"\n

Updated Sep 17th, 2020 | cPanel and Microsoft Azure have simplified the cPanel & WHM installation on Azure. Read the new install methods: Deploying cPanel & WHM on Microsoft Azure.<\/a><\/p><\/blockquote><\/figure>\n\n\n

Microsoft Azure is a growing cloud solutions provider that is being used more and more in the expanding universe of web hosting. cPanel is determined to stay ahead of the game by ensuring that Azure users are able to use cPanel & WHM to power their instances and make the best hosting platform we can.<\/p>\n

This step by step tutorial will help you install cPanel & WHM on Microsoft Azure for the first time.<\/p>\n

For new users who have not dabbled into Azure, you can create a free account and use their services for a testing period. You can signup by going to signup.azure.com<\/a>. The testing period will give you a $200 credit that you can use for 30 days.<\/p>\n

Please keep in mind that Microsoft requires verification via a phone number, email address, and a valid credit card when creating an account. After you have verified the information, you will be taken to the main dashboard where you can create and manage your instances.<\/p>\n

(For quick reference, you can access this same dashboard by going to portal.azure.com<\/a>)<\/p>\n

Step One: Getting Started and Selecting an Operating System<\/h2>\n

To get started, please refer to the set of options that are on your left side panel. At the top of this list, there is a “New” option next to a “+” sign. Click this option.<\/p>\n

<\/p>\n

After doing so, a new box will display with suggestions as to machines and images of machines to deploy. We are going to use the top search box to search for “CentOS 7.” Please refer to the screenshots for additional guidance.<\/p>\n

When it comes to CentOS 7, there are not many options. For the easiest installation, we are going to go with a simple CentOS 7 image.<\/p>\n

<\/p>\n

The reason for this is because the cPanel & WHM installation will include all necessary software that the server needs to function properly and securely. When selecting this image, a new display box will appear. It will provide quick information on the instance. At the bottom, you can click “Create” to continue to the next step for the server setup.<\/p>\n

<\/p>\n

Step Two: Server Customization<\/h2>\n

Next you will see a new box come up with several fields that you will need to fill. The server creation wizard does a great job of explaining each step, but you will be asked to name the server, pick the disk type, as well as create a server username and password. (You also have the option to provide an SSH key which would need to be generated on your personal workspace and then pasted into this box.)<\/p>\n

<\/p>\n

In this next section you will need to select the server specifications of your Azure instance. You can select whatever server best suits your needs as long as the server meets our system requirements, which you can find here: https:\/\/go.cpanel.net\/whmrequirements.<\/a><\/p>\n

Step Three: Connecting to the Server and Installing cPanel & WHM<\/h2>\n

After finishing the setup of the instance, the Azure virtual machine will display on your main dashboard. You can then click on the instance to see more information. Once here, you can see all data regarding usage, other diagnostics, and configurations regarding the machine.<\/p>\n

<\/p>\n

After you have clicked on the instance from the above dashboard, you will need to click “Connect” in the top toolbar. At this time you will be given the command you need to run to connect to the instance. Place this command in your terminal or Putty.<\/p>\n

For example:<\/p>\n\n\n\n
\n
ssh user@server.IP.address.here<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

You would use the username you established when the server was created. After running this command, you will be asked to use the password you created.<\/p>\n

If you chose to use an SSH key, you can connect to the server by using the below commands:<\/p>\n\n\n\n
\n
ssh -i \/Users\/username\/.ssh\/yoursshkey user@server.IP.address.here \nEnter passphrase for key '\/Users\/username\/.ssh\/yoursshkey':<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Once you sign into the server, you are going to need to assume the role of ‘root.’ Root is the highest level of user on the server. This is required to proceed with the installation of cPanel. To change yourself to root, run the following command.<\/p>\n\n\n\n
\n
sudo -s<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

You are now root. In order to ensure that you can access WHM as root, you now need to establish the root password. To do this, please run the following command:<\/p>\n\n\n\n
\n
passwd<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

(You will be asked to enter the new password twice.)<\/p>\n

The next step is to run a yum update. This will update all of the server’s essential software and tools. To run the update, use the command:<\/p>\n\n\n\n
\n
yum update -y<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

* The ‘-y’ option simply tells the yum update to not ask for a confirmation before proceeding *<\/p>\n

The yum update will take a few moments depending on the server’s connection to the internet. After the update is complete, you will need to change the hostname of the server. To do this, run the command below:<\/p>\n\n\n\n
\n
hostname newhostname.server.com\nhostname #you can run this to confirm the hostname did change.<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

The final step before we can begin the cPanel installation is to disable the Network Manager service of the server. To do so, please run the commands below:<\/p>\n\n\n\n
\n
systemctl stop NetworkManager.service\nsystemctl disable NetworkManager.service<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Finally, we are ready to run the cPanel installation script. The script can be found here, go.cpanel.net\/installwhm\/, as well as below:<\/p>\n\n\n\n
\n
cd \/home && curl -o latest -L https:\/\/securedownloads.cpanel.net\/latest && sh latest<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Step Four: Manage Firewall Preferences and Open Ports for cPanel & WHM<\/h2>\n

cPanel & WHM will be accessible once the installation is finished. In order to access the ports that the cPanel and WHM interfaces use, we will need to make changes to the Azure instance’s firewall preferences. This can be done by going to your Azure dashboard and then on the left-hand side, clicking on the “Networking” tab.<\/p>\n

<\/p>\n

From this page, we are going to need to add an inbound port rule and an outbound port rule. We can start by clicking on “Add Inbound Port Rule,” and a new box will appear. In this box you will be asked to fill 4 fields which I will explain below:<\/p>\n