Using Digital Ocean Spaces with WordPress

Jonny Harris avatar
  • Digital Ocean, is great and cheap VPS hosting provider. I have used them for a number of years now. I was extremely happy when Digital Ocean announced spaces, they version of scale storage akin to amazon’s S3. However, I was surprised to find that out of the box, that is doesn’t work with WordPress. In fact, the product is so new, there is a little if any information on how to implement spaces in PHP.

    After some research, it turns out the spaces is compatible with S3 SDK. I am not sure why this is, it maybe because digital ocean has given an easy migration path from s3 to spaces, with a compatibility layer. But what I think is more likely is that digital ocean spaces is just amazon’s S3 under the hood.

    Because spaces are compatible with S3 SDK calls, the amazon s3plugin from humanmade called, S3 Uploads can be used to replace WordPress’s default media function functions. Simple install to plugin and add these lines in, your wp-config.php and a mu-plugin called s3.php.

    https://gist.github.com/spacedmonkey/bdea0012b0cb25065cc1662956364df8

    Enjoy. Remember to share if you found this tip useful and leave a comment below if you have any questions.