🌐 Setup Cloudflare DDNS — Keep Your Domain Pointed at a Changing IP
Deploy Cloudflare DDNS on Ubuntu with Docker — a tiny, secure agent that automatically updates your Cloudflare DNS records whenever your home IP changes. No web UI, fully env-driven.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/networking/cloudflare-ddns/cloudflare-ddns-ubuntu.sh
chmod +x cloudflare-ddns-ubuntu.sh
sudo bash cloudflare-ddns-ubuntu.sh
Tutorial Steps
1 Download the Script
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/networking/cloudflare-ddns/cloudflare-ddns-ubuntu.sh
2 Make it Executable
chmod +x cloudflare-ddns-ubuntu.sh
3 Run the Installer
The script installs Docker if needed and starts the favonia/cloudflare-ddns agent. You supply a scoped Cloudflare API token and your list of domains via environment variables; the agent then keeps their records pointed at your current public IP.
sudo bash cloudflare-ddns-ubuntu.sh
4 Verify It Updated via the Logs
There's no web UI — you confirm it's working by reading the container logs, which show the detected IP and each record it updated:
docker logs cloudflare-ddns
Ports Used
| Port | Purpose |
|---|---|
| No ports | Outbound-only agent — no web UI, nothing to firewall inbound |
| CLOUDFLARE_API_TOKEN | A scoped token with DNS edit on your zone (never the Global Key) |
| DOMAINS | Comma-separated records to keep pointed at your public IP |