Hosting WordPress on Raspberry Pi – A complete approach

Raspberry Pi 3

I host this WordPress weblog on a Raspberry Pi 3, and this is a series of articles on how I did it. Each article focus on specific topic toward setting it up for hosting the WordPress.

To host a WordPress on Raspberry Pi is more than just a few “apt-get install” commands, there are a lot considerations such as security, response speed, etc., giving that Raspberry Pi is not as powerful as a commercial server. But if you do it correctly, the results could be quite impressive.

There are plenty of such articles already available on the Internet, so you might be wonder why another article about hosting WordPress on Raspberry Pi. Well, Most of those so-called tutorials or articles over-simplified the processes by only focus on the installation of Apache, PHP, MySQL, and WordPress. The “how to install” instructions in fact are the easy part of creating a WordPress site, and it may looks fine if you are just trying it out on Raspberry Pi or use it in a local environment, but there are much more to consider when you want to “host” the WordPress on a Raspberry Pi in the real online environment. You would need to consider site security, performance optimisation, etc.. I want to take a complete approach by assuming that I’d want to put a Raspberry Pi online as a WordPress hosting server, optimises it and see how far it can go to handle the real world traffic, along the way, I hope we all learn something new through tinkering.

Although Raspberry Pi 3 as a small $35 credit-card size computer, but it is relatively powerful with 1.2 GHz 64/32-bit quad-core ARM Cortex-A53 microprocessor, and 1 GB RAM at 900 MHz. This is often better than the low price Virtual Private Server that you can rent from some data center (you could get a single core, 512MB RAM VPS around $10/month), so if you just started or considering to build a web site, why not give it a try to start on Raspberry Pi first and see how far it can go. Although this article is based on Raspberry Pi, but the processes of setting it up could apply to any Linux server environment when you eventually want to hosting your WordPress on a commercial web hosting service.

For this project, I’m going to use a Raspberry Pi 3, with a fresh created SD card containing Raspbian Jessie Lite operating system. I’m using a MacBook Pro as my terminal and access the Raspberry Pi via SSH connection (which is likely the way when you accessing a hosted service). Since I don’t have any Window-based PC, the steps detailed in this series are written based on my Mac environment, so when I say copy to the click board, I assumed that you know that means press Command-C on the Mac. I’m also assuming all readers of this article are comfortable using the command line.

So let’s begin building our new server.

Update 14 Dec, 2016 – With the server optimisation and various caches implementation described in this series, plus some WordPress optimisation tinkering, the Raspberry Pi 3 achieved amazing scores on both GTMetric test scores, and Google PageSpeed Insights! I’m impressed on both Nginx Raspberry Pi 3 performances.

GTMetrix test result
GTMetrix test scores on WordPress running on Raspberry Pi
PageSpeed Desktop test result
Google PageSpeed Desktop test shows 95/100 score
PageSpeed Mobile test result
Google PageSpeed Insights mobile test shows 84/100 score

3 comments by readers

  1. Hey,

    your server shows this today:

    < verwendet ein ungültiges Sicherheitszertifikat. Das Zertifikat ist am 24. Dezember 2017, 00:59 abgelaufen. Die aktuelle Zeit ist 24. Dezember 2017, 11:36. Fehlercode: SEC_ERROR_EXPIRED_CERTIFICATE"

    it mean that your certificate ist expiered on "24. Dezember 2017, 00:59"

    You have to renew



  2. I do accept as true with all the concepts you’ve presented in your post. They are really convincing and can definitely work. Nonetheless, the posts are very quick for beginners. Could you please prolong them a little from subsequent time? Thanks for the post.

Leave a Reply

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