π Raspberry Pi β Networking & Web Projects: Web Server, Pi-hole, Hotspot & Media Setup
π§² Introduction β Power Up Your Raspberry Pi as a Network Hub
Raspberry Pi is more than a desktop computerβit can serve as a web server, ad blocker, Wi-Fi hotspot, or even a media streaming center. Its compact size and low power draw make it ideal for 24/7 network projects at home or in the classroom.
π― In this guide, youβll learn:
- How to install Apache or Nginx to run a web server
- How to host a local website from your Pi
- How to block ads network-wide with Pi-hole
- How to turn your Pi into a wireless hotspot
- How to run a Plex or Kodi media server
π Topics Covered
| πΉ Topic | π Description |
|---|---|
| π Raspberry Pi β Setup Web Server (Apache/Nginx) | Install and configure a web server to serve HTML or web apps |
| π§ Raspberry Pi β Pi-hole (Ad-blocking DNS) | Block ads and trackers across your entire home network |
| π°οΈ Raspberry Pi β Host Local Websites | Host personal HTML pages or local dashboards from your Pi |
| πΆ Raspberry Pi β Create Wi-Fi Hotspot | Share internet via a Wi-Fi access point created on your Raspberry Pi |
| π‘ Raspberry Pi β Setup Media Server (Plex/Kodi) | Stream music, videos, and photos from Raspberry Pi using Plex or Kodi |
π Raspberry Pi β Setup Web Server (Apache/Nginx)
Choose between Apache (easy to use) or Nginx (lightweight and fast).
πΉ Apache Installation:
sudo apt update
sudo apt install apache2
Access via browser:
http://raspberrypi.local or http://<Pi-IP>
πΉ Nginx Installation:
sudo apt install nginx
Your website files go here:
/var/www/html/
β
Test with an index.html file.
π§ Raspberry Pi β Pi-hole (Ad-blocking DNS)
Pi-hole is a powerful DNS-level ad blocker.
πΉ Install with One Command:
curl -sSL https://install.pi-hole.net | bash
Choose your DNS provider (e.g., Cloudflare), and configure the web admin interface.
πΉ Access Admin Panel:
http://<Pi-IP>/admin
Set your routerβs DNS to the Pi-hole IP to enable network-wide ad blocking.
β Supports custom blacklists, whitelists, statistics.
π°οΈ Raspberry Pi β Host Local Websites
Serve dashboards or development sites without external hosting.
πΉ Create Your Website:
Edit or replace:
/var/www/html/index.html
Add dynamic features using PHP:
sudo apt install php libapache2-mod-php
Example:
<?php echo "Hello from Raspberry Pi!"; ?>
β Ideal for self-hosted tools, dashboards, or IoT interfaces.
πΆ Raspberry Pi β Create Wi-Fi Hotspot
Turn your Pi into a wireless access point.
πΉ Requirements:
- Raspberry Pi with built-in Wi-Fi
- Ethernet connection for internet
πΉ Install Required Packages:
sudo apt install hostapd dnsmasq
πΉ Configure hostapd.conf:
interface=wlan0
driver=nl80211
ssid=PiHotspot
hw_mode=g
channel=7
wmm_enabled=0
auth_algs=1
ignore_broadcast_ssid=0
Configure dnsmasq for DHCP, then enable and start services.
β Pi acts as a router, hotspot, or local-only AP.
π‘ Raspberry Pi β Setup Media Server (Plex/Kodi)
πΉ Plex Media Server:
- Install using
dpkg:
wget https://downloads.plex.tv/... # latest .deb link
sudo dpkg -i plexmediaserver_*.deb
- Access Plex:
http://<Pi-IP>:32400/web
- Add media libraries (movies, music, photos)
πΉ Kodi Media Center:
sudo apt install kodi
Run GUI or install LibreELEC for a full media OS.
β Supports TV streaming, DLNA, HDMI output, USB drives.
π Summary β Recap & Next Steps
Raspberry Pi can power a range of network-based servicesβfrom private web hosting to ad-free browsing and wireless hotspots. With just a few packages and configuration files, your Pi becomes a compact server hub for your home or office.
π Key Takeaways:
- Install Apache or Nginx to serve web content
- Use Pi-hole for DNS-based ad blocking
- Host local websites with HTML/PHP
- Convert Pi into a Wi-Fi hotspot for field use
- Stream videos or music using Plex or Kodi
βοΈ Real-World Applications:
- Local development/test server
- Family-wide ad blocking
- Home media hub or NAS
- Portable hotspot in classrooms or remote areas
β Frequently Asked Questions
β Can Raspberry Pi host a public website?
β
Yes, but you’ll need port forwarding on your router and a dynamic DNS service.
β Does Pi-hole slow down internet speed?
β
No, Pi-hole improves browsing by blocking resource-heavy ads and trackers.
β Which is better: Apache or Nginx for Raspberry Pi?
β
Nginx uses fewer resources; Apache is more beginner-friendly with .htaccess support.
β Can I use Raspberry Pi as both a media server and web server?
β
Yes, if resources allow. Monitor memory usage for simultaneous services.
Share Now :
