Hosting your own website from home with a Raspberry Pi is completely possible, and with free tools like freedns.afraid.org and Let’s Encrypt, you don’t even need to buy a domain or SSL certificate.
Below is a step-by-step guide.
1. Requirements
You don’t want your Pi’s IP address to change on your local network.
3. Configure FreeDNS Subdomain
To make your Pi accessible from the internet, forward ports:
5. Install Nginx Web Server
On your Pi:Check if it’s working:
Open http://192.168.1.100 from a browser inside your LAN. You should see the Nginx welcome page.
6. Install Certbot (Let’s Encrypt SSL)
Certbot will issue free SSL certificates for your domain.Run Certbot for your FreeDNS domain:Follow prompts. Certbot will:7. Test Your Website
Now visit:You should see your Nginx default page, with a valid Let’s Encrypt SSL certificate.
8. Deploy Your Website
Replace Nginx’s default page with your project:Add your HTML whatever content. Or set up /etc/nginx/sites-available/ with a custom server block for advanced setups.
9. Security & Tips
Below is a step-by-step guide.
1. Requirements
- Raspberry Pi 5 (with Raspberry Pi OS installed)
- Stable internet connection
- Router with admin access (for port forwarding)
- FreeDNS account (https://freedns.afraid.org)
- Installed web server (Nginx or Apache; here I’ll use Nginx)
You don’t want your Pi’s IP address to change on your local network.
- Edit the dhcpcd.conf file:
Code:
sudo nano /etc/dhcpcd.conf - Add something like this at the bottom (adjust to your network):
Code:
interface eth0static ip_address=192.168.1.100/24static routers=192.168.1.1static domain_name_servers=8.8.8.8 1.1.1.1- 192.168.1.100 → your Pi’s fixed LAN IP
- 192.168.1.1 → your router’s IP (gateway)
- Reboot:
Code:
sudo reboot
3. Configure FreeDNS Subdomain
- Go to freedns.afraid.org
- Choose a subdomain from the Subdomains → Add section. Example:
- Domain: raspberrydevice.com
- Subdomain: myproject
- Result: myproject.raspberrydevice.com
- Type: A record → Point it to your public IP address (you can check it via https://whatismyipaddress.com)
- If your ISP changes your IP often, enable Dynamic DNS:
- FreeDNS provides a special update URL you can call with a script or cron job to keep your IP updated.
To make your Pi accessible from the internet, forward ports:
- Port 80 (HTTP) → 192.168.1.100
- Port 443 (HTTPS) → 192.168.1.100
5. Install Nginx Web Server
On your Pi:
Code:
sudo apt update && sudo apt upgrade -ysudo apt install nginx -yOpen http://192.168.1.100 from a browser inside your LAN. You should see the Nginx welcome page.
6. Install Certbot (Let’s Encrypt SSL)
Certbot will issue free SSL certificates for your domain.
Code:
sudo apt install certbot python3-certbot-nginx -yCode:
sudo certbot --nginx -d myproject.raspberrydevice.com- Verify your domain (must resolve correctly via freedns.afraid.org)
- Install SSL automatically into Nginx
- Set up auto-renewal
Code:
sudo certbot renew --dry-runNow visit:
Code:
https://myproject.raspberrydevice.com8. Deploy Your Website
Replace Nginx’s default page with your project:
Code:
sudo nano /var/www/html/index.html9. Security & Tips
- Keep your Pi updated:
Code:
sudo apt update && sudo apt upgrade -y - Use ufw firewall if needed:
Code:
sudo apt install ufwsudo ufw allow 'Nginx Full'sudo ufw enable - Consider limiting exposure by using Cloudflare as a reverse proxy if your ISP blocks port 80/443.
Statistics: Posted by verishare — Tue Sep 23, 2025 10:20 pm