How to host WordPress on DigitalOcean

digital ocean x wordpress

As detailed in another blog post, I decided to host WordPress on DigitalOcean. Here are the steps I took to make it happen:

  1. Firstly buy a domain name from e.g. porkbun/squarespace/etc
    • *we need a domain name to generate a SSL (Secure Sockets Layer) certificate when we’re running the WordPress installation
  2. Go to digitalocean.com and setup an account
  3. Go to this link and click Create WordPress Droplet, & follow the steps in this tutorial
    • For the server, you can choose the cheapest option e.g. Intel SSD – $6/month, and tick free analytics
    • There’s an option of using SSH or password to access the server. I would recommend SSH, although password is easier to setup.
  4. Go to your DNS hosting service (e.g. porkbun/squarespace/etc.) and point your name servers (NS) to DO, which should look something like ns1.digitalocean.com., ns2.digitalocean.com., ns3.digitalocean.com. (include the periods)
    • *important – do this step before SSHing / running the console, or your SSL certificate will be harder to generate
    • Create an A record (e.g. @ to your droplet resource (there should be a dropdown))
    • Create a CNAME record with hostname as e.g. www and point to alias of {domain_name.com}
  5. Click console in your project dashboard to SSH into your server
    • type y (for yes) to all the questions and generate SSH certificate
  6. Now you can access your WordPress site using {domain_name.com}/wp-admin by using the username and password you entered in step 5.
  7. You should see the WordPress admin dashboard afterwards
  8. (optional step)export your existing blog posts from e.g. wordpress.com (xml file)
  9. import XML from DO
    • go to tools -> imports -> upload your file and make sure you click include attachments (your server will download the images from your wordpress.com | site blog)

If you have some issues with the installation, you can check out the provided tutorial above or using e.g. Google. I had to do several tries as my first try failed due to me forgetting to point my domain name to the resource before setting up the site through the console. But eventually it worked 🙂

And that’s it. Enjoy 😉

Leave a Reply

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