install wordpress on raspberry pi 5

How I Built a WordPress Blog on a Raspberry Pi 5 (Part 1)

Introduction: A Tinkerer’s Vision

It started as a simple idea: host my own blog. I wanted one where I could fully control, running on hardware I owned, with minimal costs, minimal maintenance and maximum flexibility. A simple goal soon spiraled into an intricate journey involving a Raspberry Pi 5, WordPress, dynamic DNS, and a lot of lessons learned along the way.

This story isn’t just about hosting a website—it’s about exploring why self-hosting on a Raspberry Pi 5 is an excellent choice, overcoming technical hurdles, and ultimately building something sustainable, scalable, and uniquely mine.

If you’ve ever thought of hosting your own website but were unsure where to start, this three-part guide might inspire you to take the leap.

The actual Raspberry Pi5 Powered WordPress Server utilizing the Argon Neo5 NVMe Case
The actual Raspberry Pi5 Powered WordPress Server utilizing the Argon Neo5 NVMe Case

The Fork in the Road: WordPress on a Raspberry Pi 5 vs Synology NAS

I already owned a Synology DS1513 and DS213, aging NAS devices that had served me well for file storage and media streaming. At first glance, they seemed like the obvious choice for hosting my blog. But as I dove deeper, cracks began to show:

  1. Performance: The DS1513, built with a decade-old Intel Atom processor, was archaically slow compared to the Raspberry Pi 5.
  2. Energy Costs: With an average power consumption of ~50-80W, the NAS devices were significantly more expensive to run than the Pi’s ~7-15W envelope. (Let alone idle consumption 24/7)
  3. Flexibility: While Synology’s DSM is user-friendly, it comes with limitations—proprietary features and a reliance on Synology’s ecosystem.

The Raspberry Pi 5, on the other hand, had everything I needed: modern processing power, NVMe support for blazing-fast storage, and the flexibility of running a Linux-based OS. The decision was made: the Pi 5 would be the heart of my self-hosted blog.

If you are considering which Raspberry Pi 5 to get (8GB vs 16GB), have a look at this comparison post
(The Raspberry Pi 5 16GB: Worth It or a Waste of Money?) to gain a better understanding of which works for your use case and perhaps help you to save a chunk as well!


Part 1: The Evaluation Process

Why WordPress?

With the hardware decided, the next step was choosing the software. I wanted a platform that:

Ease of Setup and Use:

  • Combines blogging, content management, and website features in one platform.
  • One-time setup with a GUI for content creation and management.

Feature-Rich:

  • Built-in blogging tools (posts, categories, tags, SEO plugins like Yoast).
  • Multimedia support (easy embedding of videos and images).
  • Monetization-ready with plugins for ads, affiliate links, e-commerce, and memberships.
  • Scalable with plugins for advanced features like online courses and paid memberships.

Low Learning Curve:

  • User-friendly visual editor for non-developers.
  • No need to learn Markdown or manage deployment tools like GitHub or Netlify.

Modularity:

  • Extensive plugin ecosystem for additional features (e.g., email subscriptions, analytics, caching).

Portability:

  • Easy migration to larger hosting platforms using tools like All-in-One WP Migration.

Security and Updates:

  • Automated updates for core software, plugins, and themes to ensure security and minimal manual effort.

WordPress was the natural choice. Its massive community, extensive documentation, and flexibility made it the perfect CMS for a project like this. Before committing, though, I explored other options:

  • Drupal: Powerful but with a much steeper learning curve.
  • Ghost: Minimalist and fast but limited in features for anything beyond blogging.

In the end, WordPress’s versatility won me over. It could grow with my blog, whether I wanted to add e-commerce, memberships, or other features in the future. WordPress is free if you host it on your own machine and it works across multiple hardware architectures. If you feel this guide might be too technical, they have a range of plans that are reasonably priced that can help you get started if you’re keen on getting straight to blogging:


The Foundational Setup: Installing WordPress on the Raspberry Pi 5

1. Setting Up the Raspberry Pi 5

The journey began with setting up the Raspberry Pi 5. I chose Ubuntu Server 24.04 as the operating system for its stability and compatibility with the software stack I planned to use. After flashing the OS to an SD card, I configured Wi-Fi and reserved a static IP (eg. 192.168.1.100) to ensure reliable access.

2. Installing the LAMP Stack

To host WordPress, I needed the LAMP stack (Linux, Apache, MariaDB, PHP):

  • Apache: Installed and configured as the web server.
  • PHP: Ensured compatibility with WordPress by using PHP 8.3.
  • MariaDB: Lightweight and perfect for handling WordPress’s database.

Setting these up wasn’t without its challenges:

  • Apache initially didn’t process PHP files. This was resolved by enabling the mpm_prefork module.
  • MariaDB required careful configuration to ensure the WordPress user had proper privileges.

Challenges Along the Way: Making It Work

1. Dynamic DNS with No-IP

Since my ISP didn’t provide a static public IP, I needed a way to map my changing IP to a consistent domain name. Enter No-IP, a free dynamic DNS service. Configuring the No-IP DUC (Dynamic Update Client) on the Pi ensured my domain (nashrajovik.ddns.net) always pointed to the right place.

2. Securing the Website

Security was non-negotiable. Using Let’s Encrypt and Certbot, I added HTTPS encryption to the site. Redirecting all traffic from HTTP to HTTPS required tweaking Apache’s configuration. It was worth it, though—there’s nothing like seeing that padlock icon in the browser.

3. Database Connectivity Issues

During the WordPress setup, I hit a roadblock: the infamous “Error establishing a database connection.” After some troubleshooting, I realized the issue was incorrect credentials. A quick reset of the MariaDB user password resolved it.


The Finish Line: Customizing WordPress on the Raspberry Pi 5

With WordPress up and running, it was time to make the blog my own. I installed essential plugins:

  • Yoast SEO: To optimize content for search engines.
  • Wordfence Security: To protect against brute-force attacks.
  • UpdraftPlus: For easy backups.
  • Google Site Kit: To integrate analytics and monitor traffic.

I also customized the theme to reflect my blog’s identity—clean, simple, and professional.

The WordPress Dashboard running off the Raspberry Pi 5 with all the recommended add-ons
The WordPress Dashboard running off the Raspberry Pi 5 with all the recommended add-ons

A Broader Perspective: Why Self-Host?

Throughout this journey, I often questioned: Why not use a managed service like WordPress.com or a free platform like Ghost? The answer lay in control and learning. Hosting on the Pi 5 gave me:

  • Ownership: No dependency on external providers.
  • Scalability: Full control over plugins, themes, and configurations.
  • Cost Savings: After the initial hardware investment, ongoing costs were minimal.

A Comparison of Hosting Options

FeatureRaspberry Pi 5Synology DS1513Free Blog Platforms (e.g., WordPress Personal, Ghost, Drupal)
Setup ComplexityMedium (requires Linux skills)Low (Synology DSM is easy)Low to Medium (depending on platform)
PerformanceHigh (modern hardware)Low (outdated CPU)High (cloud-hosted)
Initial Costs~US $120 w/ NVME & PSU~US $500 with HDD/SSDFree
Running Costs (24/7)~USD $14.49/year~USD $103.50US $44.66/year (WordPress Personal Plan)
FlexibilityHigh (full server control)Medium (limited by DSM)Low to Medium (depends on platform features)
ScalabilityHighMediumMedium to High
SecurityHigh (with manual setup)MediumHigh (managed hosting options)

Final Thoughts: Lessons Learned the Evaluation Process

This project wasn’t just about hosting a website—it was a journey of discovery. I learned how to:

  • Configure and secure a Linux-based OS and host WordPress on the Raspberry Pi 5.
  • Overcome challenges like database connectivity and dynamic IPs.
  • Appreciate the power of open-source tools like WordPress and Let’s Encrypt.

If you’re considering hosting your own blog, I highly recommend starting with a Raspberry Pi 5. It’s powerful enough for most personal projects, affordable, and endlessly customizable.


What’s Next?

Part 2 will cover the hardware configuration and deployment in greater detail while part 3 will cover the LAMP setup and WordPress Initialization. Below are some of the items i plan to also add to the setup downstream.

  • Expand the blog with monetization features like affiliate links or a Patreon page.
  • Add other services to the Pi 5, like Nextcloud for personal cloud hosting.
  • Monitor and optimize website performance with caching and analytics plugins.

Building this blog was a rewarding experience. If you’ve been inspired to try something similar, let me know in the comments or reach out with questions!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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