Skip to main content
WordPress made easy with the drag & drop Total WordPress Theme!Learn More

How to Install WordPress in DigitalOcean

Last updated on:
  1. 1. Currently Reading: How to Install WordPress in DigitalOcean
  2. 2. How to Install WordPress in Microsoft Azure
  3. 3. How to Install WordPress on the Google Cloud
  4. 4. Install WordPress in AWS – Amazon Web Services
  5. 5. Introduction to Cloud Computing with WordPress

DigitalOcean is one of the fastest growing cloud hosting companies in the globe that focuses on simplicity and scale. Today we’re going to learn how to install and configure WordPress on DigitalOcean.

Why We Love DigitalOcean

Opening its doors in 2011, it soon became one of the largest cloud hosting providers with over a million users. DigitalOcean servers are known as Droplets – the smallest unit of a cloud server that you can buy starting at $5/month.

The key factor to DigitalOcean’s stupendous success is its simplicity. In addition to being a clean and simple option, there is lots more to love DigitalOcean for your WordPress site. Here are five reasons why we find DigitalOcean to be awesome.

Note: This is an optional section, you can skip it and jump right into the next section to install WordPress in DigitalOcean.

Competitive, Affordable Pricing

digitalocean pricing $5 vps droplets

DigitalOcean Pricing (September 2018)

DigitalOcean has one of the lowest pricing points in the cloud hosting industry. You can get started with your own server for as little as $5/month.

Three characteristics make DigitalOcean highly affordable.

  1. Pay-per-hour usage
  2. No minimum period of renting
  3. No setup fee (even for large setups)
  4. Plans start at $0.0007/hour
DigitalOcean's droplets start as low as $5/month!

The $5/month droplet comes with:

  • 1GB of RAM
  • 25GB of SSD storage space (SSDs are about 10x faster than traditional hard disks)
  • 1TB of bandwidth (that’s really generous)
  • 1 unit of vCPU (virtual CPU) power
  • Price: $0.007/hour which is roughly $60/year!

Automatic 1-Click Installer for WordPress

one-press wordpress install from digitalocean

1-Click WordPress Install offered by DigitalOcean

DigitalOcean has a sweet ready-made image for WordPress and a plethora of other open-source software, which makes it an invaluable asset. With a few clicks (you’ll see how) we’ll be able to create steady working installation of WordPress in no time.

Epic Community and Knowledgebase

digitalocean's community focused approach

DigitalOcean’s community-focused approach to winning customers

DigitalOcean has a plethora of tutorials on virtually any OS, any software and any (hosting related) topic! The best part – it’s meticulously tested on their droplets in order to ensure it works on your droplet as well!

Apart from tutorials, you also have active Q&A forums and interesting community projects.

Dynamic Resizing

With DigitalOcean, you can dynamically resize your droplet. Remember we talked about it in Introduction to Cloud Computing with WordPress? Whenever you need some extra juice, resizing a droplet as easy as twisting a knob to increase the volume!

Trusted by the Best Developers

digitalocean-review-customer-base

Developers love DigitalOcean

John Resig, creator of jQuery (one of the best JavaScript frameworks), Salvatore Sanfilippo, creator of Redis, and the co-founder of StackExchange, Jeff Atwood – all use DigitalOcean for their projects.

Installing WordPress on DigitalOcean

Prerequisite: Once you’ve signed up for DigitalOcean, you need update your contact information and transfer some money (around $5) to your DigitalOcean account to create your first droplet. Think of it as a prepaid phone. You can use PayPal or credit card to recharge your account. Now we are ready to create our WordPress droplet.

DigitalOcean User Account Organization: What are Projects?

creating a project in digitalocean

Projects are a basic unit of organization in your DigitalOcean account. Each project can have multiple droplets and other features (such as load balancers and object storage) that DigitalOcean has to offer. A single DigitalOcean account can have multiple projects.

We start by creating our first DigitalOcean project. Select a project name, description, project purpose and environment. An environment can be either Development, Staging or Production. For our tutorial, we’ve chosen the options as shown in the screenshot above.

Since DigitalOcean is a developer focused cloud hosting platform, they have these additional options that go a long way in helping developers organize their projects.

How to Create WordPress Droplet in DigitalOcean

Once you’ve created a project, you can now create a droplet.

create a new droplet in digitalocean in wordpress

Step 1: We start off by creating a droplet inside the WPExplorer project.

droplet os

Step 2: Select Ubuntu as your droplet’s OS and then select the One-click apps tab.

wordpress one-click image droplet in digitalocean

Step 3: Select WordPress on 18.04. This means that DigitalOcean is going to automatically install WordPress on Ubuntu 18.04.

backup and block storage options

Note – You can additionally add backups to your Droplet. However, this is not important to us since this is a tutorial. Also, this should not be confused with WordPress backups. A droplet backup are automatic system-level backups, which mean they copy everything in the OS (and not just WordPress).

Datacenter location (and additional) options in a DigitalOcean droplet

Step 4: DigitalOcean droplets can be deployed across 8 different datacenters. Since I’m located in India, I’ve selected Bangalore. It is optional to select the additional options (such as private network, IPv6, etc.) and an SSH key. Since we’re here to only install WordPress, these features won’t be necessary. However feel free to try them out in your DigitalOcean account!

creating a digitalocean droplet

Step 5: As you can see, the default project, i.e. WPExplorer is automatically selected. Enter a hostname (this is for you to remember internally) and click on Create to start creating your droplet.

digitalocean droplet ready

DigitalOcean droplet is ready!

Step 6: Once the droplet is created, you’ll see message similar to the screenshot above.

digitalocean droplet email

You should also receive a similar email in your registered DigitalOcean email account.

Logging into DigitalOcean droplet via SSH Console

It’s almost time for the famous 5 minute WordPress install. Only this time we’re going to be done within 2 minutes. We already have the IP address that we can use to login to the WordPress server. However, we need to login to our DigitalOcean droplet via SSH for a first-time configuration.

An un-configured WordPress droplet in DigitalOcean

Unless we do that, we’re going to see a message like this when we enter the IP address in our browser. You can login to your DigitalOcean droplet via SSH using Putty in Windows or Terminal in Mac. However, DigitalOcean has an even simpler way to do this, as shown below:

ssh access droplet via console

First, from you DigitalOcean dashboard, select your droplet, and then select the Access tab from the left menu. Click on Launch Console to access your droplet via SSH using your web browser.

droplet ssh access

Next, enter your username (root) and password that was emailed to you earlier. You’ll be immediately asked to create a new password for the root user account. Once you’ve reset the root password, you should see a message similar to the one above.

That’s it. We’re now ready for the famous 2-minute WordPress install!

Configuring WordPress installation on DigitalOcean

So far we’ve:

  • Created a new DigitalOcean droplet with Ubuntu and WordPress pre-installed; and
  • Logged into the droplet via SSH (using DigitalOcean’s built-in console access).

Now we need to do the final steps to get our WordPress site ready.

installing wordpress in digitalocean 1/2

Enter the IP address in your browser, and you should be greeted with the famous install screen.

installing wordpress in digitalocean 2/2

Now select a username, password and email address. The database configuration has been pre-configured by DigitalOcean. You might also want to turn off search engine visibility, if you’re testing a site. Only thing is, you should enable it once your site is ready.

Click on Install WordPress and let the magic happen.

installing wordpress in digitalocean

And there you have it – WordPress is ready.

installing wordpress in digitalocean successful

This marks the end of our basic tutorial.

Bonus: DigitalOcean For Beginners (Another Cloud Option)

Remember when we did our Cloudways hosting review a while back? Well one of the cool features that Cloudways offers is the option to choose your cloud, and one of the choices is DigitalOcean! Since Cloudways does all the heavy lifting for you, you can just point click and get started hosting your website so you can had all the awesome benefits of cloud hosting with DigitalOcean minus the setup. This makes Cloudways a great option for newbies or for people who don’t want to dig into the technical aspect of setting up cloud hosting.

Advanced WordPress configuration in DigitalOcean

Having a WordPress site in DigitalOcean is great. However, it won’t do much good if your WordPress site’s URL is an IP address. We need to link it to a domain name. Also, encrypted websites are the norm today, so we’re going to learn how to install an HTTPS certificate in our WordPress droplet.

Here’s a round-up of what we’ll be covering in our advanced WordPress configuration section:

  • Configure a domain name to your WordPress site
  • Install HTTPS for WordPress in your DigitalOcean droplet.

Configuring a domain name to your DigitalOcean WordPress droplet

In order to configure your WordPress URL, you need to:

  • Add an “A record” pointing to your droplet’s IP address and
  • Change the site URL from the WordPress admin dashboard.

It’s a two part process that needs to be done sequentially.

Part 1: Adding an A record to your domain:

This part mostly depends on your hosting provider. You should refer your hosts documentation on adding A records to your DNS. Or simply Google “how to add a record in <your domain provider>” You should get specific instructions.

If your host comes with cPanel (most shared web hosts do), we’ve got a tutorial for you right here:

cpanel dashboard in a shared host

Step 1: Login to your cPanel account and select Zone Editor. You can also use the search function in cPanel to quickly locate this tool.

adding a record in dns 1/2

Step 2: Click on + A Record to add a new A record.

 adding a record dns

Step 3: Let’s assume your domain name is example.com and you want to point it to your new DigitalOcean droplet. In this case, you need to add two A records in your DNS Zone editor. The first one is for example.com and the other is for www.example.com. Both these records will point your primary domain name to the droplet’s IP address. You should use the following configuration:

A Record #1: ‘example.com’

Name: example.com. (yes a trailing '.' is included)
Address: In the address field, add you droplet's IP address.

A Record #2: ‘www.example.com’

Name: www.example.com. (a trailing '.' will automatically appear. If it does not, ignore it!)
Address: Your droplet's IP address.

However, for our tutorial, we’re using a subdomain – digitalocean.souravkundu.in. Therefore we’ve entered a single A record for the subdomain to point to the droplet’s IP address.

Note – this setup is also useful for websites that have different subdomain for their blog. For instance “blog.productsite.com”.

A Record for our tutorial: ‘digitalocean.souravkundu.in’

Name: digitalocean.souravkundu.in.
Address: Our droplet's IP address

Once the A records are configured to point to the droplet’s IP address, it should take some time for it to reflect. (It does not happen instantaneously). This waiting period is called the DNS propagation time, and lasts up to 24 hours. However, practically speaking, it should not take more than 5 minutes if it’s a new A record.

Step 4: To verify that the A record is working, enter the URL (which in our case is digitalocean.souravkundu.in) in your browser, and you should see your WordPress site. That tells you that you’ve successfully linked your domain to your DigitalOcean droplet.

Part 2: Changing the WordPress Site URL in DigitalOcean

default wordpress install

When we’ve installed the WordPress site in DigitalOcean, the site URL is automatically configured to be the server’s IP address. We now have to change it to the new domain name we just configured.

Head over to the WordPress dashboard → Settings → General. We have to change two fields here:

  • WordPress Address (URL)
  • Site Address (URL)

Change it to the respective URL you’ve set in the A record in the previous section. It should be either ‘example.com’ or ‘blog.example.com’. Note that both the WordPress Address and the Site Address need to have the same values.

wordpress site url configuration

In our tutorial, we’ve used http://digitalocean.souravkundu.in/. Once done scroll down and hit Save to save the changes.

Your WordPress site is now ready!

Adding HTTPS to WordPress using DigitalOcean

Setting up an SSL certificate enables HTTPS on the web server, which secures the traffic between the server and the clients connecting to it. DigitalOcean pre-installs a tool called Certbot in the one-click WordPress install droplet. Certbot is a free and convenient way to set up SSL certificates on a server.

We’ll now look at how to configure Certbot in DigitalOcean to add HTTPS to your WordPress site.

According to DigitalOcean’s documentation, to use Certbot, you’ll need a registered domain name and two DNS records:

  • An A record from the domain (e.g., example.com) to the server’s IP address
  • An A record from the domain prefaced with www (e.g., www.example.com) to the server’s IP address.

This is very similar to the part 1 of the DNS configuration section. And guess what? We’ve already done it!

Once this step is done, we’ll need to login to the droplet’s console via SSH and run the following command:

certbot --apache -d example.com -d www.example.com

Only thing is example.com is replaced with your domain name. In our tutorial, since we’re only using a subdomain, the command is going to be:

certbot --apache -d digitalocean.souravkundu.in
  • There are going to be a couple of prompts when the command is running. Simply agree to them by entering ‘Y’ on the console.
  • You’ll also be asked if you want to redirect all HTTP traffic to the HTTPS version of the website. I would recommend selecting yes, since this ensures that all your visitors get the encrypted version of your website.
  • Once done, you’ll have to go back to the WordPress dashboard and change the site URL from http to https, as shown in the screenshot below.

wordpress site url change to https

Wrapping Up

DigitalOcean is one of the finest examples of developer-friendly cloud hosting providers out there. They have extensive documentation including a dedicated page for WordPress and ticket-based support system. Powered by intuitive design, user-centric guides and robust features, DigitalOcean is changing the face of cloud hosting – one droplet at a time. And with a $5/month entry point, it’s an excellent place to learn how to get your hands dirty with WordPress.

Experience the Cloud Now!

What did you think of this tutorial? Is there something you’d like us to add? We love to hear your thoughts in the comments below.

install-wordpress-digitalocean
Article by Sourav WPExplorer.com author
Subscribe to the Newsletter

Get our latest news, tutorials, guides, tips & deals delivered to your inbox.

22 Comments

  1. Tony Kaspin

    Thanks for the article! I’ve always wanted to try using Digital Ocean but never got the time to. One question, how do you remove the password that’s protecting the website? Is it as simple as going into the .htaccess using the “sudo nano” command and removing it?

    • Sourav Avatar Sourav

      Hi Tony,

      Glad you like the article. You should definitely try out DO – just for the fun of it.

      I would strongly recommend you to not remove the added layer of .htaccess security.
      However, I think that’s the right way to do it, although you should open a support ticket on this regard.

      Thanks
      Sourav

  2. djsylvester

    Very helpful for those not up on Digital Ocean. Thanks.

    You need to make one correction under Reason #1 – “Three characteristics make DigitalOcean highly affordable.”
    Point 4 states “Plans start at 7 cents an hour” but 3 decimal places ($0.007) is 7/10ths of 1 cent. At 7 cents per hour you’d almost be at the most expensive choice of $80/month.

    • Kyla Avatar Kyla

      Thank you! All fixed 🙂

    • Sourav Avatar Sourav

      Thank you for pointing it out! Kyla’s done the needful!

  3. Justin Samuel

    Hi Sourav,

    You might want to take a quick look at ServerPilot to see if it’s something you’d recommend. We’ve recently added a WordPress installer, so you can now get the server management benefits of ServerPilot on your DigitalOcean servers while still having one-click WordPress hosting. Our goal is to make WordPress hosting on DigitalOcean even easier than using shared hosting. I think with our new installers we’ve finally achieved that. I’m curious to know what you think.

    Thanks,
    Justin

    • Emily

      You save me a lots!! Thank you very much. Love it.

      • Justin Samuel

        That’s great. You’re very welcome!

  4. A.Fruit

    A note:

    Digital Ocean required me to select the $10/month tier in order to select WordPress under Applications. I’m not sure if this changed since this article, but I thought I’d point that out.

    • Kyla Avatar Kyla

      Thanks for letting us know!

  5. Odracir

    After installing the wp, there is some folder/files permission related issue. If you are very new to wp and VPS i would suggest you to practice a little bit before lunch your site. It’ll not cost you more than 5$ for one month in Digital Ocean.

  6. Emily

    If you want to start from $5 for install WordPress (DigitalOcean Auto setup force to choose $10) Then can use ServerPilot instead. Them service auto setup the whole package for you and it just Free! Thank you very much for ServerPilot

    • AJ Clarke Avatar AJ Clarke

      Cool, thanks for sharing your tip Emily!

  7. Sravan Kumar

    WordPress customization is possible with One-Click Installs for WordPress? Like our own themes, access to theme files to modify the PHP files as per our needs etc.? and can we add our own custom plugins?

  8. Nitesh

    I would like to say great effort you did by writing this article, It will help people those are not familiar with digitalocean to choose the best Cloud service provider.

  9. Sufyan

    very nice and easy steps

  10. Rashmi

    It is very clear but I believe that if you use serverpilot in the setting up the wordpress on digital ocean, it will much better for new guy who doesn’t have any technical knowledge one like here

  11. pramod

    I AM using vestacp or serverpilot for install wordpress in digitalocean.
    It is good to make cpanel. By this server management is become easy.

  12. WPWebHost

    DigitalOcean no doubts have been the most recommended providers for developers that looking to scale their resources when needed. But depending on your sysadmin skill, it may not always be the best options.

    Yes – if you know how to manage your Droplet (VPS) aside from the WordPress GUI. This include some of the server admin works. While ServerPilot would be the alternative solution for this, your total cost for a WordPress hosting would have been on the high side.

    No – if you have zero sysadmin skill as you will have problems to troubleshoot your web server when your WordPress website is down. That will cause you lots more to loose if your WordPress website is generating a tremendous traffic. What if your WordPress website is being hacked?

    Alternatively, you can look for a fully Managed WordPress hosting provider that cost you less than $10/mo and get most of the job done.

    We have posted an analysis on this at wpwebhost[dot]com/wordpress-resources/should-i-choose-digital-ocean-to-host-my-wordpress

  13. Joe

    After creating my WordPress and trying to upload a theme, it gives me an error message asking if I’m sure I want to do this. Do you know how I can fix this?

    • AJ Clarke Avatar AJ Clarke

      This is a common server error with larger themes usually it’s a memory limit related error and can be fixed by increasing your server memory’s limit to PHP. If you are using a premium theme, simply contact the developer of the theme so they can assist you. We have a troubleshooting guide for our Total theme here but it relates to a lot of themes and you may find it helpful.

  14. Jack M.

    Hi, just wondering whether you’d want to checkout the cloudserver.science review of Digital Ocean, just seen in another post of dale anyway, you’ll see amazing digital ocean videos, analysis and great opinions too, it’s worth taking a look to my mind

Leave a Reply

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

Learn how your comment data is processed by viewing our privacy policy here.