Create and remove WordPress client projects with Hetzner, Docker, and Cloudflare DNS
Quick overview
Description
Quick overview This workflow gives WordPress agencies a one-click setup for new client projects: fill in a form and get a fresh Hetzner server running WordPress, MariaDB and automatic HTTPS in Docker, with the DNS record in Cloudflare and the login sent by email. A second form removes the project again. How it works Receives a submitted n8n Form request to create a new WordPress client project or remove an existing one. For new projects, validates the form input, generates admin credentials, and builds a cloud-init script that installs WordPress via WP-CLI and starts WordPress, MariaDB, and Caddy with Docker Compose. Calls the Hetzner Cloud API to fetch SSH keys, ensure a firewall exists for ports 22/80/443, choose the cheapest matching server type for the requested RAM, and create the server. If a base domain is configured, creates an A record in Cloudflare for the project’s subdomain pointing to the new server’s IPv4 address, otherwise uses an sslip.io hostname. Waits and then polls a one-time status file on the new site until it reports ready, fails, or times out. Sends an email with the WordPress URL and login details when ready, or a troubleshooting email with SSH/log pointers if setup fails or times out. For removals, finds the Hetzner server by labels, deletes the server, optionally deletes the matching Cloudflare DNS record, and emails a confirmation. Setup Create a Hetzner Cloud API token (read/write), add at least one SSH key to your Hetzner project, and configure an HTTP Header Auth credential with Authorization: Bearer for the Hetzner HTTP requests. (Optional) Create a Cloudflare API token with Zone → DNS → Edit permissions and add a Cloudflare API credential, then set baseDomain and cloudflareZoneId in the Configuration values. Add an SMTP/email credential for the email nodes and set mailTo and mailFrom in the Configuration values. Review and customize locations, firewallName, image, and the templates JSON (plugins/theme slugs) in Configuration to match your preferred deployments. Activate the workflow and use the generated n8n Form URLs for new-wordpress-project and remove-wordpress-project (n8n user authentication is required). Requirements • Hetzner Cloud project with an API token and an SSH key • SMTP account • Optional: a domain managed in Cloudfla Customization • Add your own setup templates in the templates field of the Configuration node, using any plugin or theme slug from wordpress.org, and add the same name to the form dropdown. • Change the allowed server locations or the polling limit. • Replace the email nodes with Slack or your project management tool to hand new projects to your team. Additional info A server with 4 GB RAM costs about 6.50 euros per month at Hetzner, billed by the hour. Server files are stored in /opt/wp, the setup log in /var/log/wp-setup.l. An n8n automation workflow template by Christian.
Community Metrics
Author
Christian
Platform
web
Pricing model
free
Categories
- Automation
Tags
- n8n
- workflow
- send-email
- http-request
- code
Capabilities
- 3 nodes