Python Ruby Shell PHP
Clone or download
swalkinshaw Merge pull request #1014 from TangRufus/wp-cli-gpg
[BREAKING] Update wp-cli to 2.0.0 and verify its PGP signature
Latest commit 17c26fc Aug 12, 2018
Failed to load latest commit information.
.github Update Dec 3, 2016
bin update xdebug tunnel configuration: update ssh connections to allow t… Jun 25, 2018
deploy-hooks Revert "build-before: Checkout project source code to local temporary… Jun 19, 2018
group_vars Re-enable xdebug remote Jun 26, 2018
hosts Update some documentation notes Mar 29, 2016
lib/trellis Bump Ansible version_tested_max to 2.5.3 (#981) May 20, 2018
roles Use `copy` instead of `synchronize` Aug 12, 2018
.editorconfig Add reverse_www filter to fix www_redirect Feb 18, 2016
.gitignore Git: Ignore `vagrant.local.yml` Mar 1, 2018
.travis.yml Ansible 2.0 compatibility Jan 13, 2016 Update wp-cli to 2.0.0 and verify its PGP signature Aug 12, 2018 Add Code of Conduct [ci skip] Nov 28, 2017 Initial commit Apr 16, 2014 Add gold sponsor [ci skip] Apr 8, 2018
Vagrantfile Rubocop fixes for Vagrantfile Jun 14, 2018
ansible.cfg Update Ansible default plugin paths in config files (#958) Mar 8, 2018
deploy.yml Bump Ansible version_tested_max to 2.5.3 (#981) May 20, 2018
dev.yml Update to PHP 7.2 Feb 13, 2018
requirements.yml #1011 change name of swapfile ansible requirement to match updated n… Jul 9, 2018
rollback.yml Ansible 2.4 compatibility Sep 20, 2017
server.yml Change swap role Jun 11, 2018
vagrant.default.yml Allow local configuration of vagrant_mount_type Jun 14, 2018
variable-check.yml Add tags to select includes and tasks Dec 30, 2015
xdebug-tunnel.yml update xdebug tunnel configuration: update ssh connections to allow t… Jun 25, 2018


Release Build Status

Ansible playbooks for setting up a LEMP stack for WordPress.

  • Local development environment with Vagrant
  • High-performance production servers
  • One-command deploys for your Bedrock-based WordPress sites

What's included

Trellis will configure a server with the following and more:

  • Ubuntu 16.04 Xenial LTS
  • Nginx (with optional FastCGI micro-caching)
  • PHP 7.2
  • MariaDB (a drop-in MySQL replacement)
  • SSL support (scores an A+ on the Qualys SSL Labs Test)
  • Let's Encrypt integration for free SSL certificates
  • HTTP/2 support (requires SSL)
  • Composer
  • WP-CLI
  • sSMTP (mail delivery)
  • MailHog
  • Memcached
  • Fail2ban
  • ferm


Full documentation is available at


Make sure all dependencies have been installed before moving on:


The recommended directory structure for a Trellis project looks like:      # → Root folder for the project
├── trellis/      # → Your clone of this repository
└── site/         # → A Bedrock-based WordPress site
    └── web/
        ├── app/  # → WordPress content directory (themes, plugins, etc.)
        └── wp/   # → WordPress core (don't touch!)

See a complete working example in the repo.

  1. Create a new project directory: $ mkdir && cd
  2. Clone Trellis: $ git clone --depth=1 && rm -rf trellis/.git
  3. Clone Bedrock: $ git clone --depth=1 site && rm -rf site/.git

Windows user? Read the Windows docs for slightly different installation instructions. VirtualBox is known to have poor performance in Windows — use VMware or see some possible solutions.

Local development setup

  1. Configure your WordPress sites in group_vars/development/wordpress_sites.yml and in group_vars/development/vault.yml
  2. Run vagrant up

Read the local development docs for more information.

Remote server setup (staging/production)

For remote servers, installing Ansible locally is an additional requirement. See the docs for more information.

A base Ubuntu 16.04 server is required for setting up remote servers. OS X users must have passlib installed.

  1. Configure your WordPress sites in group_vars/<environment>/wordpress_sites.yml and in group_vars/<environment>/vault.yml (see the Vault docs for how to encrypt files containing passwords)
  2. Add your server IP/hostnames to hosts/<environment>
  3. Specify public SSH keys for users in group_vars/all/users.yml (see the SSH Keys docs)
  4. Run ansible-playbook server.yml -e env=<environment> to provision the server

Read the remote server docs for more information.

Deploying to remote servers

  1. Add the repo (Git URL) of your Bedrock WordPress project in the corresponding group_vars/<environment>/wordpress_sites.yml file
  2. Set the branch you want to deploy
  3. Run ./bin/ <environment> <site name>
  4. To rollback a deploy, run ansible-playbook rollback.yml -e "site=<site name> env=<environment>"

Read the deploys docs for more information.


Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Gold sponsors

Help support our open-source development efforts by contributing to Trellis on OpenCollective.

Kinsta Harness Software KM Digital ThemeIsle


Keep track of development and community news.