| date_modified | 2026-04-03 10:00 | |
|---|---|---|
| date_published | 2026-04-03 10:00 | |
| description | Deploy Trellis WordPress sites to Hetzner Cloud servers. Create servers, configure settings, and automate WordPress deployment to Hetzner Cloud. | |
| title | Deploying Trellis to Hetzner Cloud | |
| authors |
|
Hetzner Cloud is a cloud infrastructure provider offering virtual servers with competitive pricing that can handle most normal WordPress sites when provisioned with Trellis.
::: tip ℹ️ Sign up for Hetzner Cloud through the Roots referral link to receive $20 in cloud credits. :::
Trellis CLI comes with a trellis server create command to automatically create and provision a server for a specified environment:
$ trellis server create --provider=hetzner production::: warning This command requires a Hetzner API token. :::
If the HCLOUD_TOKEN environment variable is not set, the command will prompt for one.
To avoid passing --provider every time, set Hetzner as your default provider in trellis.cli.yml:
server:
provider: hetznerThen you can simply run:
$ trellis server create production$ trellis server create productionThe remote server playbook will run and provision your server with PHP, Nginx, and everything else included in Trellis.
The command help file can be accessed by passing the --help flag:
$ trellis server create --helpAfter creating a new server, your local project will have a modified hosts file for the environment that you provisioned:
[production]
-your_server_hostname
+49.13.25.100
[web]
-your_server_hostname
+49.13.25.100Once your server is provisioned you'll want to perform the first deploy. If you try to visit your site before deploying you'll see a server 500 error.
$ trellis deploy productionAfter the first deploy is done, you can now either install WordPress by visiting the site or even import an existing database.