Need help with trellis?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

2.2K Stars 568 Forks MIT License 1.6K Commits 54 Opened issues


Ansible playbooks for a WordPress LEMP stack

Services available


Need anything else?

Contributors list


MIT License Release Build Status Follow Roots

Ansible-powered LEMP stack for WordPress
Built with ❤️

Official Website | Documentation | Change Log


Trellis is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features and products within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider donating using the links below:

Donate via Patreon Donate via PayPal


Ansible playbooks for setting up a LEMP stack for WordPress.

  • Local development environment with Vagrant
  • High-performance production servers
  • Zero-downtime deploys for your Bedrock-based WordPress sites
  • trellis-cli for easier management

What's included

Trellis will configure a server with the following and more:

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


Full documentation is available at


Make sure all dependencies have been installed before moving on:

Windows user? Read the Windows getting started docs for slightly different installation instructions.


Using trellis-cli

Create a new project:

$ trellis new


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
  1. Install Trellis:
$ git clone --depth=1 [email protected]:roots/trellis.git && rm -rf trellis/.git
  1. Install Bedrock into the
$ composer create-project roots/bedrock site

Local development setup

Using trellis-cli

  1. Review the automatically created site in
  2. Customize settings if necessary

Start the Vagrant virtual machine:

$ trellis up


  1. Configure your WordPress sites in
    and in
  2. Ensure you're in the trellis directory:
    cd trellis
  3. Run
    vagrant up

Read the local development docs for more information.

Remote server setup (staging/production)

A base Ubuntu 18.04 (Bionic) or Ubuntu 20.04 (Focal LTS) server is required for setting up remote servers.

  1. Configure your WordPress sites in
    and in
    (see the Vault docs for how to encrypt files containing passwords)
  2. Add your server IP/hostnames to
  3. Specify public SSH keys for
    (see the SSH Keys docs)

Using trellis-cli

Initialize Trellis (Virtualenv) environment:

$ trellis init

Provision the server:

$ trellis provision production

Or take advantage of its Digital Ocean support to create a Droplet and provision it in a single command:

$ trellis droplet create production


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

Provision the server:

$ ansible-playbook server.yml -e env=

Read the remote server docs for more information.

Deploying to remote servers

  1. Add the
    (Git URL) of your Bedrock WordPress project in the corresponding
  2. Set the
    you want to deploy (defaults to

Using trellis-cli

Deploy a site:

$ trellis deploy  

Rollback a deploy:

$ trellis rollback  


Deploy a site:

$ ./bin/  

Rollback a deploy:

$ ansible-playbook rollback.yml -e "site= env="

Read the deploys docs for more information.


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

Trellis sponsors

Help support our open-source development efforts by becoming a patron.

Kinsta KM Digital Carrot C21 Redwood Realty Motto


Keep track of development and community news.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.