This article walks you through the best method I’ve found for hosting your own website from home. It works over any standard Internet connection, doesn’t require a static IP address, and best of all — it costs nothing. You don’t even need a dedicated server. You could run this off the same PC you’re using right now. That’s exactly what I’m doing!
Normally, if you wanted to self-host a website, you’d either rent server space from a hosting provider, or pay your ISP for a static public IP address. Neither is ideal. In this guide, I’ll show you how to bypass both of those requirements entirely — using free tools and, in my case, a plain old wireless home connection.
Big thanks to Grant Eastwood, who first pointed me in this direction and helped me get it working.
The Tools You’ll Use
Cloudflare Free
Cloudflare is a connectivity cloud providing security, performance, and networking services. Two features matter most here:
- CDN: Cloudflare caches your site across global data centres — fast load times regardless of your home Internet speed.
- Cloudflare Tunnel: A lightweight daemon called
cloudflaredcreates outbound-only connections to Cloudflare’s network. Your home machine is never directly exposed to the Internet, no static IP needed, and no firewall ports to open.
WordPress Open Source
WordPress is the world’s most popular CMS, powering more than 40% of all websites. It lets you build and manage a site through a friendly interface without writing code — think of it as a word processor for the web.
Docker Free
Docker runs applications in lightweight, isolated containers. For this project it means you don’t install a full web server directly onto your PC — spin it up when you need it, shut it down when you don’t. Available for Windows, macOS, and Linux. 😉
Hardware — Even an Old Laptop Works
This very site is hosted on an old laptop sitting at home. Almost any computer will do. Laptops are particularly well-suited:
For a small personal site this is all you need. Scale up later if traffic demands it — but there’s no need to worry about that now. 🙂
Domain Name
You’ll need a registered domain name (e.g. yoursite.com). Your options:
| Option | Cost | Notes |
|---|---|---|
| DigitalPlat FreeDomain | Free | No ads. Non-standard extensions (.us.kg etc.) |
| GetFreeDomain.name | Free | Free domains with limited extensions |
| Namecheap | ~$10–15/yr | Reliable, affordable, popular .com registrar |
| NameSilo | ~$9–12/yr | Competitive pricing, free WHOIS privacy |
| Cloudflare Registrar | At-cost | No markup. Keeps everything in one place since you’re already using Cloudflare! |
Step-by-Step Setup
- A computer running Linux, Windows, or macOS
- A registered domain name (see above)
- A free Cloudflare account
Install Docker
For Windows and macOS, install Docker Desktop using the official links below — it includes everything you need:
For Linux (Ubuntu), do not use Ubuntu’s built-in apt packages — they are outdated and missing the Compose plugin. Instead, follow these steps to install from Docker’s official repository:
1a — Remove any old Docker packages
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done1b — Add Docker’s official repository
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update1c — Install Docker Engine and the Compose plugin
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugindocker-compose-plugin — this is what provides the docker compose command used in Step 2. Ubuntu’s default repositories don’t include it, which is why installing from Docker’s own repo is essential.1d — Verify everything is working
docker --version
docker compose versionYou should see version numbers for both. If docker compose version returns a result, you’re good to go.
Set Up WordPress with Docker
Create a new folder for your project and save the following as docker-compose.yml. This uses the official WordPress Docker image.
version: '3'
services:
db:
image: mysql:8.0
restart: always
environment:
MYSQL_ROOT_PASSWORD: your_root_password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: your_db_password
volumes:
- db_data:/var/lib/mysql
wordpress:
image: wordpress:latest
restart: always
ports:
- "8080:80"
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: your_db_password
WORDPRESS_DB_NAME: wordpress
volumes:
- wordpress_data:/var/www/html
depends_on:
- db
volumes:
db_data:
wordpress_data:Replace your_root_password and your_db_password with your own secure passwords, then start it:
docker compose up -d8080 as shown. Don’t change it to port 80 — some systems reserve that port and it causes permission issues.Once running, open http://localhost:8080 to confirm WordPress is loading.
Add Your Domain to Cloudflare
- Log in to your Cloudflare dashboard.
- Click Add a domain and enter your domain name.
- Select the Free plan.
- Cloudflare will display two nameserver addresses. Go to your domain registrar and update the nameservers to match.
- Wait for propagation — usually a few minutes, up to 24 hours. Cloudflare emails you when confirmed.
Create a Cloudflare Tunnel
- In the Cloudflare dashboard, open Zero Trust.
- Navigate to Networks → Tunnels.
- Click Create a tunnel, choose Cloudflared as the connector type, then click Next.
- Give your tunnel a name (e.g.
my-home-server) and click Save tunnel.
Install cloudflared on Your Machine
Cloudflare will show an install command tailored to your OS. Copy and paste it into your terminal. On Ubuntu it looks like:
curl -L --output cloudflared.deb \
https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared.deb
sudo cloudflared service install <YOUR_TUNNEL_TOKEN>Configure a Public Hostname
In the tunnel settings, go to the Public Hostname tab and click Add a public hostname:
| Field | Value |
|---|---|
| Subdomain | Leave blank for yourdomain.com, or enter www |
| Domain | Select your domain from the dropdown |
| Service Type | HTTP |
| URL | localhost:8080 |
Click Save hostname.
Complete the WordPress Installation
Navigate to your public domain (e.g. https://yourdomain.com). The WordPress setup wizard should appear. Choose your site title, create an admin username and secure password, and within a couple of minutes your site will be live! 🎉
Conclusion
It took me quite a while to piece all of this together from various sources, but once you understand how the parts fit together it’s surprisingly straightforward. Cloudflare does the heavy lifting on security and performance, Docker keeps things clean and portable, and WordPress gives you a full-featured platform to build on — all at zero cost.
If you hit any snags, or spot anything that could be clearer, drop a comment below. I’ll do my best to help, and good feedback may make its way into an updated version of this guide. Good luck! 🙂


Leave a Reply