June 12, 2023

Streamlined WordPress Hosting: DigitalOcean Guide



DigitalOcean is a powerful cloud hosting platform that offers excellent performance and scalability for hosting WordPress websites. In this blog post, we will walk you through the step-by-step process of getting started with DigitalOcean for WordPress hosting. From registration and droplet setup to LAMP installation and WordPress setup, we’ve got you covered. We will also guide you on how to connect your Google domain to your DigitalOcean droplet for a seamless website experience.

Step 1: Registration on DigitalOcean:

To begin, follow this referral link: https://m.do.co/c/3310abfe2cc4 to sign up for a DigitalOcean account. By using the referral link, you will receive some credits that can be used towards your hosting costs.

DigitalOcean Website Landing Page Screenshot
DigitalOcean Website

Step 2: Droplet Setup:

  1. Once registered, log in to your DigitalOcean account.
  2. Click on the “Create” button and select “Droplets.”
  3. Choose the desired configuration for your droplet, such as the server location, size, and operating system (Ubuntu 20.04 LTS is recommended).
  4. Select additional options like backups and monitoring if needed.
  5. Set a hostname for your droplet, and click on “Create Droplet” to proceed.
DigitalOcean Dashboard - Droplet
DigitalOcean Dashboard – Droplet

Step 3: LAMP Setup using PuTTY (Windows):

  1. Download PuTTY from the official website – putty.org and install it on your computer.
  2. Launch PuTTY and enter your droplet’s IP address.
  3. In the left-hand menu, navigate to “Connection” > “SSH” > “Auth.”
  4. Browse and select your private key file (.ppk) for authentication.
  5. Return to the “Session” section, enter a name for your session, and click “Save.”
  6. Click “Open” to establish the SSH connection with your droplet.
  7. Once connected, run the following commands to install LAMP:
    • Update package lists: sudo apt update
    • Install Apache web server: sudo apt install apache2
    • Install MySQL server: sudo apt install mysql-server
    • Secure MySQL installation: sudo mysql_secure_installation
    • Install PHP and required modules: sudo apt install php libapache2-mod-php php-mysql
    • Restart Apache: sudo systemctl restart apache2
PuTTY Software on Windows
PuTTY Software

Step 4: WordPress Setup:

  1. Download the latest WordPress package from the official website.
  2. Use an FTP client to upload the package to the web server’s document root directory (/var/www/html).
  3. Extract the WordPress package: sudo unzip wordpress.zip
  4. Rename the sample configuration file: sudo mv wp-config-sample.php wp-config.php
  5. Open wp-config.php and update the database details:
    • Database name: Replace ‘database_name_here’ with your chosen name.
    • Username: Replace ‘username_here’ with your MySQL username.
    • Password: Replace ‘password_here’ with your MySQL password.
  6. Save the changes and close the file.
  7. Access your website in a browser to start the WordPress installation.
    • Enter your domain or IP address in the address bar.
    • Follow the on-screen instructions to complete the installation.

Step 5: Google Domain Connection with DigitalOcean:

  1. Log in to your DigitalOcean account.
  2. In the DigitalOcean dashboard, click on the “Networking” tab at the top and select “Domains” from the dropdown menu.
  3. Click on the “Add Domain” button.
  4. Enter your domain name and click on “Add Domain” to proceed.
  5. After adding the domain, you will see a list of DNS records.
  6. Take note of the three nameservers provided by DigitalOcean (e.g., ns1.digitalocean.com, ns2.digitalocean.com and ns3.digitalocean.com).
DigitalOcean Domain Setup in Droplet
DigitalOcean – Domain Setup in Droplet

Step 6: Update Google Domain DNS Settings:

  1. Log in to your Google Domains account.
  2. Navigate to your domain management page.
  3. Under the “DNS” tab, scroll down to the “Name servers” section.
  4. Select the option “Use custom name servers.”
  5. Enter the DigitalOcean nameservers you obtained in Step 5 (e.g., ns1.digitalocean.com, ns2.digitalocean.com and ns3.digitalocean.com).
  6. Click on “Save” to update the DNS settings.
Google Domains - Custom Name Servers Setup
Google Domains – Custom Name Servers Setup

Step 7: Configure DNS Records in DigitalOcean:

  1. Go back to the DigitalOcean dashboard and click on the domain name you added in Step 5.
  2. In the domain settings page, click on the “DNS” tab.
  3. Add the necessary DNS records for your Google domain to connect with your DigitalOcean droplet.
    • Add an A record:
      • Enter “@” in the “Hostname” field.
      • Enter your droplet’s IP address in the “Will direct to” field.
      • Click on “Save” to add the A record.
    • Add a CNAME record for the “www” subdomain (optional):
      • Enter “www” in the “Hostname” field.
      • Enter “@” in the “Will direct to” field.
      • Click on “Save” to add the CNAME record.
DigitalOcean - Domain DNS Records Setup
DigitalOcean – Domain DNS Records Setup

Step 8: Wait for DNS Propagation:

  1. DNS propagation can take some time, usually ranging from a few minutes to several hours.
  2. It’s recommended to wait for the changes to propagate globally before proceeding.
Online DNS Check
Online DNS Check


By following these steps, you have successfully set up DigitalOcean for WordPress hosting. From registering on DigitalOcean, setting up your droplet and LAMP stack using PuTTY, to installing WordPress and connecting your Google domain with DigitalOcean, you are now ready to build and manage your WordPress website with ease. Enjoy the benefits of DigitalOcean’s powerful infrastructure and unleash the full potential of your WordPress site.

share on facebook share on linkedin

Related Reads