Skip to content

Trellis Docs


Trellis assumes your WordPress configuration already has multisite set up. If not, ensure the following values are placed somewhere before calling Config::apply() in Bedrock's config/application.php and before provisioning your server:

You'll also need to update the multisite settings under your environment directory (group_vars/<environment>/wordpress_sites.yml):

You may also want to define the env dictionary for more multisite specific settings such as DOMAIN_CURRENT_SITE or PATH_CURRENT_SITE.

That env will be merged in with Trellis' defaults so you don't need to worry about re-defining all of the properties.

Here's an example of a complete entry set up for multisite:

After provisioning your remote server and deploying your sites, you'll need to install WordPress as a final step in your staging and production environments. SSH into your server as the web user with ssh web@<domain> and in the /srv/www/<domain>/current/ directories run the following WP-CLI command to install WordPress:

You may notice that your network's main site URLs contain /wp/ before the post's or page's pathnames. This is a problem in WP core which occurs when WordPress is located in a subdirectory, as is the case with Bedrock. See issue Bedrock issue #250 for details, along with the site URL fix plugin in the Multisite Fixes plugin collection for a solution.

If you use Let's Encrypt as your SSL provider and your multisite install uses subdomains, currently you have to generate individual certificates for each of your subdomains, but this may change soon as Let's Encrypt will begin issuing wildcard certificates in January of 2018. You can generate SSL certificates for your subdomains if you know these subdomains in advance while provisioning your server. To do this, define multiple canonical entries under site_hosts in your corresponding wordpress_sites.yml file like this:

Subdomains locally

For subdomains in development, you'll need DNS entries for every subdomain/host. The Landrush Vagrant plugin is how you can do this. Install it via:

Landrush spins up a small DNS server that allows us to use wildcard subdomains, a requirement for subdomain multisite installs.

Some users may have external DNS issues when using Landrush. If you encounter this, add this to your Vagrantfile:

See issue #511 for more details.

Debugging Landrush

If something goes wrong with Landrush such as not being able to resolve a website from the guest:

And remove any extraneous entries and try again.


Getting Started