Why is it not possible to get wordpress with one click on a 512 MB droplet?

April 5, 2016 1k views
WordPress One-Click Install Apps Ubuntu

I have done this in the past, but I see that now it is not available.

"This size doesn't have enough disk space to support the image you selected".

How can this be a space issue?
Does this mean that if I do the process manually a 512 MB droplet is not good enough for a small low traffic site?

4 Answers

Hey There. I maintain the WordPress One-Click image. This change was made several months back. The restriction was put in place based on memory requirements but our system only currently restricts creates based on the size of the droplet used to generate the image with the message showing the disk space message (there is a ticket open internally to update this).

We chose to restrict WordPress droplets to the 1GB size because a standard WordPress + LAMP install on a 512MB droplet will, within a week, crash due to MySQL running out of memory.

You can still create a 512MB WordPress droplet.

Copy the script found here.

On the create page, select a 512MB droplet and Ubuntu 14.04 LTS as your operating system.

Check the "user-data" checkbox and paste the script into the box that appears.

Select any other options and click create.

If you plan to launch more droplets like this you can immediately power off the new droplet and create a snapshot image to use for new creates.

To get around MySQL crashing the first thing you'll want to do is to create a swap file on your droplet. These commands will create a 1GB swap file, enable it and set it to be used automatically on reboot:

fallocate -l 1G /swapfile;
chmod 600 /swapfile;
mkswap /swapfile;
swapon /swapfile;
 echo "/swapfile   none    swap    sw    0   0" >> /etc/fstab;

I would also recommend using a caching plugin or CDN. Placing CloudFlare's free service in front of your droplet or using an existing caching or CDN wordpress plugin can do this. While a CDN and caching are not absolutely necessary, they should speed up your site's load time and lessen the load if you receive a lot of traffic.

I hope this information will help. We want to make it as easy as possible to create the stack you want to run but continuing to offer a WordPress image for 512MB droplets that was likely to crash if you didn't take further steps to optimize it was not a user-friendly way to do it.

If you have any other questions or run into any problems we're here to help.

  • Thanks for the detailed reply Ryan. Actually I was looking into this because I have an older one click install that is crashing because of memory :) Even when using swap.
    Thanks for the script also.

    I found the best way to go on with the 512MB droplet is to create it as Ubuntu and then use Serverpilot to install everything needed. It is then all configured in the best and most secure way to run Wordpress out of the box and pretty quickly, so it is the best option I see.

    I also found this article on their site about reducing memory usage.

    Let's see... I am interested to see how well this will work.

    • Awesome! Unfortunately our one-click images are generally default configurations. Doing optimizations on those images poses problems since a single image and configuration must be deployable and usable on all droplet sizes. The optimizations you use on a 512MB droplet are very different from how you would configure a droplet with 64GB/RAM.

    • Another thing to check if you are running out of memory and mysql is crashing is if you are getting hit by an XMLRPC attack on your wordpress install.

      I had this happen on a new wordpress droplet I just setup recently, a bot was hitting /xmlrpc.php so hard it crashed my mysql instance. This was a brand new site that was getting no traffic otherwise, but bots seem to scan the digitalocean IP space fairly regularly looking for attacks like this.

      Check out this article for how to check and what you can do about it (you will see lots of POST attempts to xmlrpc.php in your apache access logs)

      WordPress is a popular and powerful CMS (content management system) platform. Its popularity can bring unwanted attention in the form of malicious traffic specially targeted at a WordPress site. There are many instances where a server that has not been protected or optimized could experience issues or errors after receiving a small amount of malicious traffic. This guide will show you how to protect WordPress from XML-RPC attacks on an Ubuntu 14.04 system.
      • This is an excellent point. If you are not utilizing any plugins that require xmlrpc.php you can quickly disable access to it by running

        a2enconf block-xmlrpc
        service apache2 restart

        block-xmlrpc is an extra apache configuration file we included with the one-click image because of just this issue. As some plugins will not work while this is enabled, it is available, but disabled by default.

Hopefully this ain't considering commenting out of term, but yes basicly what ryan said a lot of people had crash problems, I don't use wordpress myself but I do have a 512mb droplet and had mysql memory problems, and every post I have seen prople always say use a swap file to fix it.

The solution I found was that linux puts the ram into a cache "to supposedly make it more available, by releasing it", there is a string you can type into the terminal that will release the ram from cache, I put it into a cron job on my server and it runs it after so many hours,

And never had a crash since, so it's possible it may work for using wordpress also, would just have to test, when I get off work I can copy the script and paste it here if anyone wants to try it.

  • Thanks! I'm definitely interested in the script. I see the memory cache thing you mention and it would help I believe. I'd like to try it.

    The reason I was looking into the one click installation was actually because I have a site set up 2 years ago with one click install and it started crashing some months back. Memory problems.

    I wanted to see if I could start over. I've looked into it to update everything, use caching, disable plugins, optimize database but the issue remained. Enabling swap helped for a while, but still the issue was there. I also contacted support and they gave me some links on server optimization, told me to check logs and if there is any bottle necks.

    Funny that after spending hours looking into guides and questions here I find the right answer like this :)

  • This is really interesting. I'd be interested in seeing this script as well (for my own personal projects). :)

create a new file and paste this in it


echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

and save it and call it

then in the terminal type sh and the location of the file if your in the folder where you put it just type in the name you called it after sh, after hitting enter to find out if it worked run top and look at the used mem compared to the free mem, also helps if you run top first to see what the mem status is at

you may have to type sudo first if your not using root

  • Nice! Thanks! Will try it out, see how it goes.
    I looked into this a little bit and here they suggest to do a sync before. So I guess it's good practice to add it to the script.

So here is how I finally got a wordpress site on a 512 MB droplet:

  1. Created a new Ubuntu 14.04 droplet
  2. Connected it to Serverpilot and installed wordpress (quick, easy, customized with swap enabled and with automatic updates)
  3. Made sure to have as low memory usage as possible
  4. Used a caching plugin
  5. Set up Cloudflare
  6. Used Cron to schedule to drop caches daily like so (it seems I needed to do this as root):
@daily sync
@daily echo 1 > /proc/sys/vm/drop_caches
@daily echo 2 > /proc/sys/vm/drop_caches
@daily echo 3 > /proc/sys/vm/drop_caches

I'll be monitoring the site, see how it goes.

Have another answer? Share your knowledge.