Launch an Azure Virtual Machine

Last modified: June 15, 2023


Overview

This document explains how to create an Azure® virtual machine with a cPanel & WHM image.

Log in to your Azure account

Log in to your Azure account. If you do not have an account, sign up for one.

Go to the cPanel & WHM listing in the Marketplace

Warning:

We strongly recommend you only create a virtual machine from the cPanel & WHM marketplace listing. Creating an Azure virtual machine directly from the Virtual machines interface will not configure some settings properly.

  1. Navigate to the cPanel & WHM for Azure listing in the Marketplace.
  2. Choose your desired operating system:
    • cPanel & WHM - Bring your own license for a CentOS server.
    • cPanel & WHM on Ubuntu - Bring your own license for an Ubuntu® server.
    • cPanel & WHM on Rocky Linux - Bring your own license for a Rocky Linux server.
  3. Click Create. The Create a virtual machine interface will appear.

Create the virtual machine

Once you are on the Create a virtual machine interface, perform the following steps:

  1. Select your Project details:

    • Subscription — Select the subscription to pay for the virtual machine.
    • Resource group — Either select an existing resource group or use the default (New) Resource group value to create a new resource group.
      Note:
      • If you do not select an existing resource group, Azure will use the Virtual machine name you enter to name a new resource group.
      • We recommend you make a new resource group any time you create a virtual machine. It is easier to delete all parts of the virtual machine by deleting the resource group rather than the individual parts.
  2. Enter your Instance details:

    • Virtual machine name — Name your virtual machine.
      Warning:

      You cannot change this name after you create the virtual machine.

    • Region — Select the instance’s region. We suggest that you select a region that is close to you, your customers, or your customers’ visitors.
    • Availability options — Select infrastructure redundancy options.
    • Security type — Select the desired level of security for your virtual machine from the following options:
      • Standard — Select this option for the basic level of security for your virtual machine.
      • Trusted lanuch virtual machines — Select this option to protect against attacks on Gen 2 virtual machines with configurable features like secure boot and virtual Trusted Platform Module (vTPM).
      • Confidential virtual machines — Select this option for higher confidentially.
    • Image — This menu will populate with the image for the operating system you selected. If it does not, you can manually select the image.
    • VM architecture — Select the desired architecture for your virtual machine.
    • Run with Azure Spot discount — Select whether to use Azure Spot.
      Important:

      We strongly recommend you do not use Azure Spot for your cPanel & WHM virtual machines.

    • Size — Select the VM size for your virtual machine.
      Warning:

      Even though cPanel & WHM requires a minimum of 1GB of RAM and 20GB of disk space, we recommend at least 2GB of RAM and 40GB of disk space.

      For more information about hardware requirements, read our Installation Guide - System Requirements documentation.

  3. Enter your Authentication type details:

    Note:
    • If you use a password for your administrator account, you can easily log into WHM using your administrator username and password.
    • If you use an SSH key for authentication, there are extra steps before you can log in to WHM for the first time. Follow the instructions in the Log in for the first time section below.
    • Azure automatically generates an SSH key pair and allows you to store it for future use.

    • SSH public key
      • Username — Enter the administrator username for the virtual machine.
      • SSH public key source — Select the source of the key:
        • Generate a new key pair — Generate a new key pair. Then, enter a Key pair name.
        • Use existing key stored in Azure — Select a key from Stored Keys.
        • Use existing public key — Paste your public key into the SSH public keys field.
    • Password
      • Username — Enter the administrator username for the virtual machine.
      • Password — Enter a password for your virtual machine’s administrator account.
      • Confirm password — Confirm your password.
  4. There are further customizations you can make to your virtual machine using the Disks, Networking, Management, Monitoring, Advanced, and Tags tabs. You do not need to enter any information in those tabs to create a virtual machine. However, for more information, read Azure’s Linux virtual machine documentation.

  5. Click Review + create. An interface with all the details of your potential virtual machine will appear.

  6. Review the details of your virtual machine, then click Create.

    Note:

    If you chose to create a new SSH key pair, after you click Create, you will have the option to download your key. We highly recommend you download it.

  7. A deployment interface will appear, showing the virtual machine creation’s progress. It will also list all of the associated resources for your virtual machine.

  8. Once deployment is complete, a Your deployment is complete message will appear. Click Go to resource to access information on your virtual machine.

  9. Your server’s public IP address appears under the Public IP address field. You will use this IP address to connect to your server via SSH or WHM.

The WHM installation process

When you create a virtual machine, WHM will automatically begin installation in the background. To watch the installation progress, log in to the instance via SSH and run the following command:

sudo su -l
Warning:

The installation process takes about 10-15 minutes. You cannot log in to WHM until the installation process is complete.

Logging in to WHM for the first time

Logging in to WHM for the first time differs based on your administrator account’s authentication method.

Using a password

If you use a password for your administrator account, you can log into WHM using your administrator username and password. In a web browser, connect to your virtual machine’s public IP address using HTTPS on port 2087. For example: https://192.0.2.0:2087. The cPanel & WHM installation process creates a limited version of a reseller account using that username and password.

If you need to access your virtual machine’s root account, perform the following steps:

  1. Log in to WHM.
  2. Navigate to WHM’s Change Root Password interface (WHM » Server Configuration » Change Root Password).

You cannot change the root password for the instance in the Azure portal. To change the root password, use one of the following interfaces:

Using an SSH key

If you choose to use an SSH key rather than a password, you must perform the following extra steps before you can log in to WHM for the first time:

  1. If using a new key pair, add your key to your computer.

    On an macOS® computer that uses the default download folder:

    1. Run the following command, where example represents the key pair’s name:
    mv ~/Downloads/example.pem ~/.ssh
    1. Run the following command to modify the permissions for the .pem file, where example represents the key pair’s name:
    chmod 600 ~/.ssh/example.pem
    1. Run the following command to add the key pair, where example represents the key pair’s name:
    ssh-add ~/.ssh/example.pem
    An `Identity added` message will appear.

    On a Windows® computer that runs the PuTTY client and uses the default download folder, perform the following steps:

    1. From the Windows Start menu, open PuttyGen.

    2. Under the Conversions heading, click Import.

    3. Navigate to the PuTTY Key Generator interface and select the .pem key you downloaded. Click Open.

    4. Enter a passphrase in the Key passphrase and Confirm passphrase text boxes.

    5. Click Save private key and save the key as a .ppk file.

    6. From the Windows Start menu, open PuTTY.

    7. In the Session interface, enter the following information:

      • Hostname (or IP address) — You virtual machine’s IP address.
      • Port — Enter 22.
      • Connection type — Select SSH.
      • Saved sessions — Enter a name for your session. Then click Save.
    8. Navigate to the Auth interface under the SSH category.

    9. Click Browse, select the .ppk file you created, and click Open.

  2. After completing the installation of WHM on your virtual machine, log in to your virtual machine’s administrator user over SSH. Use the following command, where key represents the file path of your SSH key, user represents the user you created with your virtual machine and IP represents your virtual machine’s IP address:

    ssh -i key user@IP

  3. To get a temporary WHM login URL, run the following command:

    sudo whmlogin

  4. Use that login URL to add a password to the root user.

Configure WHM

For more information on configuring cPanel & WHM, read our WebHost Manager documentation.

For more information on how to quickly build a website on a newly-installed cPanel & WHM server, read our From WHM to Website documentation.

Note:

cPanel & WHM requires a valid license. If this is a new installation, you can activate a free 15-day trial license.

Managing your virtual machine

For more information on managing your Azure virtual machine, read Microsft’s® tutorial on managing virtual machines in Azure.

Additional Documentation