Guidelines to setup a perfect Digital Ocean VPS

As you can see, since last week, I did not publish new post because I have moved to Digital Ocean after a trial month. In the last few years I’ve used a lot of hosting providers. If you aren’t aware, I’ve been with HostGator for years, but after the last few months, I’ve been noticing their VPS services were slow. As my previous hosting contract was coming to an end and my friend has recommended Digital Ocean, I decided to take a look and was instantly surprised. DigitalOcean was just what I was looking for. Until now I’ve never actually found any that have been able to satisfy my needs at the right price. In this post, I’m going to let you guys know why I switched and why Digital Ocean is my host of choice right now.

Why I Moved to Digital Ocean & How to setup a perfect VPS
Why I Moved to Digital Ocean & How to setup a perfect VPS

What’s about Digital Ocean

Basically, what Digital Ocean provides, is a VPS (Virtual Private Server), they offers cloud servers with SSD storage. They are pretty new, much like a younger brother to major VPS providers like Linode etc. Digital Ocean is more of a DIY host, where you need to decide what OS you want, configure SSH access, build a firewall, install the various languages you need, and so forth.

What makes Digital Ocean different? That’s why I moved to Digital Ocean

A Brief Note on Cost Differences

Where in the world today can you get a SSD storage machine on a Tier-1 Network with 1 TB Data transfer pre-packaged for $5? Its only at Digital Ocean. Can you believe that?? Me neither!! I don’t know how they can afford to do it like that, but they just got a customer for life! Every other provider with comparable solutions, charge you at least 6-8 times as much, AND in most cases you get either a slower machine, or a sandboxed solution, basically not being true VPS. But Digital Ocean does, now I’m using Digital Ocean.

Tranfer all my website in just 30 minutes

I’m a Linux user since 2007, that’s why I can create a droplet, install Ubuntu, install LAMP stack with Vanish then complete tranfer all my website from Hostgator to Digital Ocean in 30 minutes. Don’t worry, you can do like that with a ton of Digital Ocean articles which help new user can manage their VPS.
When it comes to my servers and development projects, I’m a control freak. If I think making a tweak might improve performance, I want to be able to try it. For example, once I had the site setup on DigitalOcean, I quickly installed the awesome mod_pagespeed module by Google into Apache and began testing and tweaking to further improve my response time. Now, my website’s Pagespeech score is 93 instead 71 when I was hosted on HostGator.
Another thing that makes them a worth try is the ease at which you can do backups. They call it Snapshots and a snapshot is an image of the system at the point a snapshot is generated. Simple shutdown the droplet, click Take snapshot and you are done. But the problem is that you have to take the VPS down to be able to take snapshots.

Service Support

Digital Ocean’ Support has been terrific. So far, I had absolutely no problems with them. Even when I encounter a problem, I open up a support ticket and a reply comes in about 6 – 8 minutes. I’m running my website on Digital Ocean for a month without  technical issues, but I’m satisfying with their support sevice.

Guidelines to setup a perfect VPS

[adsense ad_client=ca-pub-0297902515090400 ad_slot=3999285131 width=336 height=280]

As you see, I use WordPress as my website. So I will building a VPS with Ubuntu, Apache, PHP, MySQL (LAMP), I’m not use Nginx because Nginx is not appropriate server for for WordPress.
I created a new droplet with the lowest plan, and kicked it to Ubuntu 12.04 x64. Digital Ocean emails you the root password for the machine after it’s kicked (doesn’t take long at all), and then you’re on your way. I started by installing Apache, MySQL, and PHP one at a time using apt-get.
To make it dead simple you can choose WordPress on Ubuntu 12.10 under Create > Select Image > Applications

Server Control Panel: CPanel or ZPanel?

Not like another hosting providers, they give you use CPanel as webhost control panel for free. If you want to using it, you must pay $200 annually, that’s why I choosed ZPanel as alternative webhost control panel. It’s free and powerful but had some limitations.

  • At this time, ZPanel only officially supported Ubuntu 12.04 LTS, CentOS 6.4 and Windows. If you want to install it on another Linux distro or OS, you must do it by yourself.
  • ZPanel not support Nginx, Varnish as well.
  • It hasn’t officially automatic scripts installer.

Install ZPanel is very easy. Just follow Digital Ocean’s article How To Install and Configure ZPanel on an Ubuntu 12.04 VPS on their Help & Community section. Because ZPanel setup phpMyAdmin, FPT Account, Autobackup, VHOST, securing PHP with Suhosin … you will get a high quality as fast-food VPS ready to deploy your website.
I followed some good tutorials provided by Digital Ocean:

  1. How to Set Up a Host Name with DigitalOcean
  2. How To Install and Configure Varnish with Apache on Ubuntu 12.04
  3. How To Set Up Mod_Rewrite
  4. How to Get Started With mod_pagespeed with Apache on an Ubuntu and Debian Cloud Server
  5. How To Configure Logging And Log Rotation In Apache On An Ubuntu VPS
  6. Server Optimization articles
  7. Security articles

Many configurations right? But I configured exactly as I want and I don’t depend wait for any staff support to install or configure a new feature in my host.

Common VPS issues and tips

MySQL Problems!

I read about this problem first, so I can setup VPS running without it by simple tricks. The Digital Ocean images have no swap space allocated by default. That’s cause of MySQL problem when your VPS run out memory. Luckily this seemed to be a common question for Digital Ocean. They have a step by step by step guide for setting it up on Ubuntu 12.04.

Setting up Your VPS Firewall

Digital Ocean doesn’t provide firewalling as a service. A good way to manage firewall setup on Ubuntu is to use Uncomplicated Firewall that configures iptables for you. he server will allow port 22, 80, and 443 access from anywhere, while limiting connections to 22 in an attempt at least somewhat mitigate the roving machinery that will at some point try to brute-force an SSH login:

# apt-get install ufw
# ufw enable
# ufw logging low
# ufw limit 22/tcp
# ufw allow 80/tcp
# ufw allow 443/tcp

Digital Ocean gives you console access to running boxes via their website. This bypasses firewall restrictions on the box – i.e. you can change the rule set above to allow SSH access from your IP address only:

# ufw delete limit 22/tcp
ufw allow from aaa.bbb.ccc.ddd to any port 22

Backup your website on the cloud

Digital Ocean give you backup feature as a piggybacking service as 20% of your hosting plan. If you want create a VPS snapshot image, you need power of it then wait for image creating process finish before turn on your website. Because I’m running Ubuntu, why am I not use Dropbox to backup complete website to cloud in real time? I found the way to run, config, setup Dropbox via command line by use Just read about it on Using the Official Dropbox Command Line Interface.
Remember don’t sync all your Dropbox data to server by use exclude command. Encrypt all other data to prevent piracy eyes.
Your data are very important. Don’t lose yourself or trust about their service, do it by yourself.

Take a look with Digital Ocean

Unfortunately, Digital Ocean not offer trial plan. You need pay before use their service.

Digital Ocean Plan
Digital Ocean Plan


DigitalOcean offers an extremely fast cloud technology allowing its users to manage their infrastructure in a more efficient manner. With its flexible API, high-performance SSD storage and the capability to choose the closest data center location, DigitalOcean has successfully made its name in the market in no time. Needless to say I am very satisfied with the result.

Update 2013.12.30
If you want to create a droplet for testing, don’t forget destroy it after it done because Digital Oceant still charge you for used time even it turned off.

32 thoughts on “Guidelines to setup a perfect Digital Ocean VPS”

  1. Hi,

    Great guide. I’m a big fan of DigitalOcean.

    You might also want to check out our control panel, ServerPilot, as an alternative to ZPanel. We have a lot of DigitalOcean users who are very happy with ServerPilot.


  2. Chào bạn,

    Tôi tên Bình. Bạn đã viết một bài viết rất hay về DigitalOcean. Hiện tôi cũng đang sử dụng dịch vụ này. Cảm thấy có nhiều điểm tương đồng nên muốn kết bạn.

  3. Your link to “How to Get Started With mod_pagespeed with Apache on an Ubuntu and Debian Cloud Server” is wrong, looks like it was copied from the next link below it.

    Good introduction, thanks!

    • Very simple, just install dropbox then create a symlink of website folder to your ~/Dropbox (or your custom folder).
      Because our server hasn’t GUI, so I’m using dropbox cli that’s called as

  4. Thanks for the great write up. I was on GoDaddy and now i am trying WebSynthesis. Synthesis is good but expensive. I am quite comfortable on Linux and have been thinking about VPS solutions. I think DO provided that little extra push. I am going to work over the next couple weeks to move over to DO.

    I see that you say WP does not work well on Nginx. But I am going to give Nginx a try.

    Also, why not use webmin for control panel instead of zpanel? Any thoughts here?

  5. This is a very well written and concise article and is just what I was looking for!!

    I’ve been using Debian and Ubuntu Linux VPSs on Digital Ocean for 5 months now for compiling applications. My current web hosts have terrible support and after reading this article, I’m going to take the leap and try to do it myself.

    Got to say as well… the Digital Ocean VPSs have been absolutely incredible for the price and they are very fast and extremely flexible and they just cannot be rated highly enough.

  6. Thanks for the great article and advice. Why isn’t NGNIX not good for WordPress? Can you be specific. I’ve actually moved all my sites over to Apache and NGNIX on top of Apache. A Small Orange offers that setup. They also have SSD setups at very reasonable prices.

    Also FYI – you have a 403 on the WordPress navigation link.



    • Nginx isn’t good for WordPress if you haven’t enough experience with it or you running WordPress on stand alone LEMP. A typical example is .htaccess and permanlink, almost plugins, themes has wrote with Apache’s .htaccess support, so it’s most problem and you need more time, resource to maintenance your WordPress.
      The problem with WordPress navigation link has fixed, it’s occurred because it’s not in ignore list of W3 Cache plugin :D

  7. Hi Nguyen,
    I loved your article, but I’d like to know if it still updated. I mean, not about whether DigitalOcean is a good hosting or not, but about, if you still hosting on DigitalOcean…
    If so, do you still help with the service and supporting?


    • Yes, it’s still update. Currently I’m using Digital Ocean and I don’t planning to change. Next month, I’ll change from W3 Total Cache + WordPress + Nginx + PHP-FPM to WP Super Cache + WordPress + Nginx + HHVM then I will writing new tutorial about it.
      If you want to ask somethings, feel free to comment on this post, I’ll reply ASAP ;)

  8. I been using DO for long time and recently migrated to – big difference – I think there is a problem when providers gets bigger and degrade service quality gradually.

Comments are closed.