See llms.txt for all machine-readable content.

Back to Templates

Create and remove WordPress client projects with Hetzner, Docker, and Cloudflare DNS

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

  1. Receives a submitted n8n Form request to create a new WordPress client project or remove an existing one.
  2. 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.
  3. 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.
  4. 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.
  5. Waits and then polls a one-time status file on the new site until it reports ready, fails, or times out.
  6. 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.
  7. For removals, finds the Hetzner server by labels, deletes the server, optionally deletes the matching Cloudflare DNS record, and emails a confirmation.

Setup

  1. 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 <token> for the Hetzner HTTP requests.
  2. (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.
  3. Add an SMTP/email credential for the email nodes and set mailTo and mailFrom in the Configuration values.
  4. Review and customize locations, firewallName, image, and the templates JSON (plugins/theme slugs) in Configuration to match your preferred deployments.
  5. 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