Ansible-powered LEMP stack for WordPress
Website Documentation Releases Support
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:
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
Trellis will configure a server with the following and more:
- Ubuntu 20.04 Focal LTS
- Nginx (with optional FastCGI micro-caching)
- PHP 8.0
- 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
See the full installation docs for requirements and our getting started pages for more OS specific instructions.
Create a new project:
$ trellis new example.com- Review the automatically created site in
group_vars/development/wordpress_sites.yml - Customize settings if necessary
Start the Vagrant virtual machine:
$ trellis upRead the local development docs for more information.
A base Ubuntu 18.04 (Bionic) or Ubuntu 20.04 (Focal LTS) server is required for setting up remote servers.
- Configure your WordPress sites in
group_vars/<environment>/wordpress_sites.ymland ingroup_vars/<environment>/vault.yml(see the Vault docs for how to encrypt files containing passwords) - Add your server IP/hostnames to
hosts/<environment> - Specify public SSH keys for
usersingroup_vars/all/users.yml(see the SSH Keys docs)
Provision the server:
$ trellis provision productionOr take advantage of its Digital Ocean support to create a Droplet and provision it in a single command:
$ trellis droplet create productionRead the remote server docs for more information.
- Add the
repo(Git URL) of your Bedrock WordPress project in the correspondinggroup_vars/<environment>/wordpress_sites.ymlfile - Set the
branchyou want to deploy (defaults tomaster)
Deploy a site:
$ trellis deploy <environment> <site>Rollback a deploy:
$ trellis rollback <environment> <site>Read the deploys docs for more information.
Assuming you're using the standard project structure, you just need to make the project trellis-cli compatible by initializing it:
$ trellis initHelp support our open-source development efforts by becoming a GitHub sponsor or patron.
Keep track of development and community news.
- Join us on Roots Slack by becoming a GitHub sponsor or patron
- Participate on the Roots Discourse
- Follow @rootswp on Twitter
- Read and subscribe to the Roots Blog
- Subscribe to the Roots Newsletter