This tool synchronizes Nginx Proxy Manager (NPM) hosts with Cloudflare DNS. It automatically creates CNAME records in Cloudflare for every proxy host defined in NPM.
- Automatic Sync: Watches for new NPM hosts and adds them to Cloudflare.
- Root Domain Support: Optionally creates A/AAAA records for the root domain.
- Configurable: usage via Docker Environment Variables or Home Assistant UI.
You can run this container alongside Nginx Proxy Manager using Docker Compose.
- Clone this repository or create a
docker-compose.ymlfile. - Create a
.envfile based on.env.example:cp .env.example .env
- Edit
.envand fill in your Cloudflare and NPM credentials. - Start the container:
docker-compose up -d
| Variable | Description |
|---|---|
CF_API_TOKEN |
Cloudflare API Token (Edit zone DNS permissions required) |
NPM_API_URL |
URL to NPM (e.g., http://npm:81) |
NPM_EMAIL |
NPM Login Email |
NPM_PASSWORD |
NPM Login Password |
CHECK_INTERVAL |
Sync interval in ms (default: 10000) |
You can install this directly as a Home Assistant Add-on.
- Add Repository:
- Go to Settings > Add-ons > Add-on Store.
- Click the 3 dots (top right) > Repositories.
- Add the URL of this GitHub repository.
- Install:
- Refresh the store.
- Search for "NPM Cloudflare Sync" and click Install.
- Configure:
- Go to the Configuration tab of the add-on.
- Fill in your Cloudflare Token and NPM details.
- Start:
- Click Start on the Info tab.
All options found in the .env file are available in the Configuration tab in Home Assistant.
- Build:
npm run build - Run:
npm start - Docker Build:
docker build -t npm-cloudflare-sync .