Pi
Portfolio Project ยท Self-Hosted Infrastructure

WordPress on
Raspberry Pi

A Raspberry Pi 4 running a full LAMP stack, self-hosted WordPress portfolio with SSL, automated backups, and 24/7 uptime for under โ‚ฌ11/year.

Pi 4
Hardware
8GB
RAM
LAMP
Stack
โ‚ฌ0.88
Per Month
๐ŸŽฏ

The Goal

Build a fully self-hosted WordPress portfolio server on a Raspberry Pi 4, no shared hosting, no cloud dependency. Full control over the stack, the data, and the infrastructure.

๐Ÿ”ง

What I Built

A production LAMP stack on Ubuntu Server 24.04, complete with SSL via Let's Encrypt, MariaDB database, Apache virtual host configuration, and automated backup scripts.

๐Ÿ’ก

Why It Matters

This site munyakazi.org runs entirely on this Raspberry Pi. Every project you read here is served from a device consuming less power than a light bulb, running 24/7 from my home in Berlin.

Project Specifications

Tech Stack & Hardware

Every component chosen for reliability, low power consumption, and real-world performance.

Hardware
Raspberry Pi 4 (8GB)
128GB microSD card ยท ARM Cortex-A72 ยท ~3.5W average power draw
Operating System
Ubuntu Server 24.04 LTS
Headless server configuration ยท SSH access ยท Static IP assigned
Web Server
Apache2
Virtual host configuration ยท .htaccess rules ยท mod_rewrite enabled
Database
MariaDB
Lightweight MySQL-compatible database ยท Optimised for low-RAM environments
Language
PHP
Current stable release ยท Tuned php.ini settings for Raspberry Pi memory limits
SSL & Domain
Let's Encrypt + Certbot
Auto-renewing TLS certificate ยท Custom domain ยท HTTPS enforced site-wide
Implementation

Setup Process

Seven steps from blank SD card to live WordPress site with HTTPS.

1
Flash Ubuntu Server to SD Card
Used Raspberry Pi Imager to write Ubuntu Server 24.04 LTS to a 128GB microSD. Configured headless SSH access before first boot.
2
Configure SSH & Static IP
Connected via SSH, assigned a static local IP, updated all packages, and configured hostname and timezone for the Berlin environment.
3
Install Apache, PHP & MariaDB
Full LAMP stack installation via apt. Tuned PHP memory limits and MariaDB buffer settings to run efficiently within the Pi's 8GB RAM.
4
Upload & Configure WordPress
Downloaded latest WordPress, configured wp-config.php with database credentials, set correct file permissions (755/644) and Apache virtual host.
5
Domain & Port Forwarding
Configured DNS A record pointing to home IP, set up router port forwarding (80/443), and enabled dynamic DNS to handle IP changes automatically.
6
SSL Certificate with Certbot
Installed Certbot and obtained a Let's Encrypt certificate. Configured auto-renewal via cron. All HTTP traffic redirected to HTTPS.
7
Backup Automation
Wrote a shell script to back up the WordPress database and files on a schedule. Script documented in the GitHub repository with full instructions.
Running Costs

Energy Efficiency Analysis

Calculated at the German average electricity rate of โ‚ฌ0.35/kWh for 24/7 operation.

Model Avg Power Monthly kWh Monthly Cost ๐Ÿ‡ฉ๐Ÿ‡ช Yearly Cost
Pi 4 (8GB) โ€” This Setup ~3.5W ~2.52 kWh ~โ‚ฌ0.88 ~โ‚ฌ10.73
Pi 5 (16GB) ~6.0W ~4.32 kWh ~โ‚ฌ1.51 ~โ‚ฌ18.40
Shared Hosting (comparable) โ€” โ€” ~โ‚ฌ5โ€“โ‚ฌ15 ~โ‚ฌ60โ€“โ‚ฌ180
What This Project Demonstrates

Skills & Competencies

๐Ÿง
Linux Administration
Ubuntu Server, SSH, package management, file permissions, system tuning
๐ŸŒ
Web Server Config
Apache2 virtual hosts, .htaccess, mod_rewrite, HTTPโ†’HTTPS redirect
๐Ÿ”’
SSL & Security
Let's Encrypt TLS, Certbot auto-renewal, Wordfence, security hardening
๐Ÿ—„๏ธ
Database Management
MariaDB setup, WordPress DB configuration, performance tuning for low RAM
๐Ÿค–
Shell Scripting
Backup automation scripts, cron jobs, scheduled maintenance tasks
๐ŸŒ
DNS & Networking
Domain configuration, A records, dynamic DNS, port forwarding (80/443)
๐Ÿ’ฐ
Cost Optimisation
Self-hosted vs cloud cost analysis, โ‚ฌ10.73/year vs โ‚ฌ60โ€“โ‚ฌ180 shared hosting
๐Ÿ“ฆ
Version Control
GitHub repository with config files, backup scripts, and full documentation

Explore the Code

The full setup guide, Apache config, backup script, and wp-config sample are available on GitHub. Browse the repository or explore more projects.

5 2 votes
Article Rating
Subscribe
Notify of
guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jean Claude Munyakazi
9 months ago

I built this setup as both a personal learning journey and a way to gain full control over my online presence. Hosting my portfolio on a Raspberry Pi might sound ambitious, but itโ€™s proven to be stable, cost-effective, and incredibly rewarding. If you’re curious about the process or thinking of trying something similar, feel free to drop a comment, happy to exchange ideas!

Remba
Remba
Reply to  Jean Claude Munyakazi
9 months ago

I enjoyed going through it while having my morning coffee ๐Ÿ™‚

Jean Claude
Reply to  Remba
9 months ago

Hey Remba! ๐Ÿ˜Š

Thanks so much for checking out the project, I’m really glad to hear you enjoyed it (especially with your morning coffee, thatโ€™s the best combo!). It means a lot to me. More cool setups and experiments are coming soon, so stay tuned!
Let me know if you have any feedback or ideas, always happy to exchange thoughts.

3
0
Would love your thoughts, please comment.x
()
x