Roots and WP Packages are independent open source projects, supported only by developers like you. We’ve been improving the WordPress developer experience since 2011, and your support keeps it independent.
Deploying Trellis to Hetzner Cloud
Hetzner Cloud is a cloud infrastructure provider offering virtual servers with competitive pricing that can handle most normal WordPress sites when provisioned with Trellis.
âšī¸ Sign up for Hetzner Cloud through the Roots referral link to receive $20 in cloud credits.
Creating a new server
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
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: hetzner
Then you can simply run:
$ trellis server create production
Quick start (region and size will be prompted)
$ trellis server create production
The remote server playbook will run and provision your server with PHP, Nginx, and everything else included in Trellis.
Additional options
The command help file can be accessed by passing the --help flag:
$ trellis server create --help
Changes made after running the command
After 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.100
Deploying
Once 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 production
After the first deploy is done, you can now either install WordPress by visiting the site or even import an existing database.
Last updated