← Back to Articles
The Tech Collective

Build Your Own Nonprofit Web Server

A practical guide to turning a $75 Raspberry Pi into a self-hosted web server, cutting recurring hosting costs and keeping donor and program data under your organization's control.

Small nonprofits and community organizations often find themselves stuck between two bad options: expensive managed hosting that drains the annual budget, or free-tier cloud services that monetize your data and can disappear without warning. A Raspberry Pi web server offers a genuine third path—self-hosted infrastructure that costs next to nothing to run, lives entirely on your premises, and trains your volunteers in real systems administration.

The Case for a Pi Server

For under $100 in hardware, you can host a public-facing website, an internal wiki, a donation portal, or a program registration system. The ongoing operating cost is essentially the electricity to power the Pi—about $3–5 per year. Compare that to even modest shared hosting at $120–300 annually, and the savings are immediate. More importantly, the data stays local. Donor lists, participant intake records, and financial documents never pass through a third-party cloud provider's terms of service.

Volunteers who assemble and maintain the server gain transferable skills: Linux command-line fluency, basic networking, SSL certificate (a digital certificate that encrypts traffic between your server and visitors' browsers, enabling HTTPS) management, and firewall configuration. Those skills don't expire when a grant cycle ends.

Choosing Your Web Server Software

Several proven web servers run well on a Raspberry Pi. The right choice depends on what your organization needs to host.

Apache

Apache remains the most versatile and widely supported option. If you plan to run software like WordPress, Drupal, or Django, Apache's module ecosystem and .htaccess flexibility make it the safest default.

Install it with:

sudo apt update
sudo apt install apache2

Enable it to start on boot:

sudo systemctl enable apache2

NGINX

If your site is mostly static content—brochure pages, event listings, annual reports—NGINX delivers noticeably better performance under load. It uses fewer resources and handles concurrent connections more efficiently than Apache.

Install with:

sudo apt update
sudo apt install nginx

Caddy

Caddy is the easiest option for organizations without dedicated IT staff. It automatically obtains and renews Let's Encrypt SSL certificates, handles HTTPS redirection out of the box, and has a configuration file that is readable even to newcomers.

Install Caddy on Raspberry Pi OS with:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Pairing with a Database

Dynamic sites need a database. MariaDB is the default on Raspberry Pi OS and is straightforward to install:

sudo apt install mariadb-server
sudo mysql_secure_installation

For simpler applications, consider SQLite instead. It requires no background service, stores data in a single file, and backs up by copying that file. That simplicity is valuable when your volunteer team rotates seasonally.

Securing the Server

A public-facing server needs three basic protections:

  1. Firewall: Allow only ports 80 (HTTP), 443 (HTTPS), and 22 (SSH):

    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    sudo ufw allow 22/tcp
    sudo ufw enable
    
  2. SSL Certificates: Use Let's Encrypt for free, trusted certificates. If using Caddy, this is automatic. With Apache or NGINX, install Certbot:

    sudo apt install certbot python3-certbot-apache
    sudo certbot --apache -d yourdomain.org
    
  3. Fail2Ban: Protect against brute-force login attempts:

    sudo apt install fail2ban
    sudo systemctl enable fail2ban
    

Training Volunteers for Handoff

The biggest risk to a DIY server is not hardware failure—it is knowledge walking out the door when a volunteer moves on. Mitigate this by:

Why This Matters for Nonprofits

When you self-host, you eliminate per-seat SaaS pricing, data retention clauses, and vendor lock-in. A donor database on your own server cannot be mined for advertising profiles. An event registration form cannot be suspended because a free tier expired. And when a volunteer learns to troubleshoot Apache on a Sunday evening, your organization gains resilience that no subscription fee can buy.

Total one-time cost: approximately $75 for a Raspberry Pi 4 kit with case and power supply. Annual operating cost: under $5 in electricity. The skills your team develops are reusable across every future technology decision you face.

💬
Continue the conversation in the forum
Town Square · Community Tool Shed · The Tech Collective · Sustainable Communities · and more
Join the Forum →