Launch an Azure Virtual Machine


Last modified: September 17, 2020

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, then sign up for one.

Go to the cPanel 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.

Navigate to the cPanel & WHM for Azure listing on the Marketplace. Then, 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 leave it set to (New) Resource group.
      Note:
      • 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.
      • If you do not select an existing resource group, this will display as (New) Resource group. It will use the Virtual machine name you enter to name a new resource group.
  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 your region.
    • Availability options — Select infrastructure redundancy options.
    • Image — This will prepopulate with the cPanel & WHM BYOL - Gen1 image. If it does not, you can manually select it.
    • Azure Spot instance — 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:

      For cPanel & WHM to properly function, you must use at least 1 GB of RAM.

  3. Enter your Administrator account details:

    • Authentication type — You can choose to use an SSH public key or a password.
      • 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.
    • Username — Enter the administrator username for the virtual machine.
    • SSH public key source — If you choose to use an SSH key, select the source of the key.
      Important:

      We recommend you only use an SSH key if you are comfortable using the command line.

      • 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 — 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, 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 to show the virtual machine creation’s progress. It will also list all the associated resources that are also created for your virtual machine.

  8. Once deployment is complete, you’ll get a success notification with a link to your virtual machine.

The WHM installation process

When you create a virtual machine, WHM will automatically begin installation in the background. You can watch the installation progress via your virtual machine’s serial console. To access your virtual machine’s serial console:

  1. Access your virtual machine, using one of the following options:

    • Click the message that appears on the deployment progress screen after your virtual machine deploys.
    • Enter Virtual Machines in the search bar then select your machine.
    • From your Azure portal home page.
  2. Once on your virtual machine’s page, scroll the left hand menu down to the Support + troubleshooting section and click Serial console.

Once on the serial console, you can watch the progress of WHM’s installation. If there are any errors in installing WHM, they will show up in red.

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, log in to WHM then use WHM’s Change Root Password interface (WHM >> Server Configuration >> Change Root Password).

Using an SSH key

If you 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.

    Note:

    If you did not download your key while launching your virtual machine, you can access it from Azure’s Resource groups interface. Click the name of your virtual machine’s resource group then the name of the key.

    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
      
    2. 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
      
    3. 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 our Azure Virtual Machine Management documentation.

Additional Documentation