Today I decided to finally get some Dynamic DNS (DDNS) up and running at home and as I use Cloudflare for my DNS on my domain(s) I went in search of a Docker container I could add to my Raspberry Pi 4. Luckily for us, a great container exists for this very purpose (thanks, oznu!)

Deploying The Cloudflare Dynamic DNS Container

I usually deploy via Docker Compose so that’s what I’ll outline first. Both of the below will do the same thing, however. I’ve pre-filled the environment fields here as an example so both of these assume that my API Key is 1234 and I want to update the ddns A record on the domain.

For your setup, you’ll need to update the API Key to the one generated via your Cloudflare Dashboard (giving it Edit DNS permissions on your chosen domain) and if you wanted to set up you’d set your ZONE to and SUBDOMAIN to home. The PROXIED field defines whether or not you want to proxy requests to your subdomain over CloudFlare’s CDN. Change this to “true” if you want to do that. (This can sometimes cause issues with certain pieces of software so you can always leave this unfiltered and if a specific piece of software needs the proxy, you can set up a CNAME record and filter that!)

Docker Compose

version: '2'
    image: oznu/cloudflare-ddns:latest
    restart: always
      - API_KEY=1234
      - SUBDOMAIN=ddns
      - PROXIED=false

Docker Run

docker run \
  -e API_KEY=1234 \
  -e \
  -e SUBDOMAIN=ddns \
  -e PROXIED=false \

Both of these will run across most ARM-based SBC (Raspberry / Orange Pi, ASUS Tinkerboards, RockPi etc) and 64bit systems but if you have any issues, let me know in the comments and I’ll see if I can help!

This took me all of 5 minutes to get up and running and now I can have a constantly updated Dynamic DNS entry for my home network. You could use this to point CNAME records at for self-hosted projects, or even to ensure your NGINX Proxy Manager is always up-to-date on the correct IP.

About Author


What started out with a Pi Model B 10 years has grown into 15+ Raspberry, Orange, Mango Pis etc sitting on my desk in various states of benchmarking. Hopefully not all of it was in vain!

Leave a Reply

Your email address will not be published.