Ansible-powered LEMP stack for Craft 3.
Fork of Trellis, an Ansible-powered LEMP stack for WordPress
Website Documentation Releases Community
Trellis (Crellis' upstream) is an open source project and completely free to use. If you've benefited from our projects and would like to support our future endeavors, please consider sponsoring Roots.
Crellis is a collection of Ansible playbooks for setting up a LEMP stack for Craft 3.
- Local development environment with Vagrant
- High-performance production servers
- Zero-downtime deploys for your Craft sites
Crellis will configure a server with the following and more:
- Ubuntu 22.04 Jammy 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
- sSMTP (mail delivery)
- MailHog
- Memcached
- Fail2ban and ferm
Full documentation is available at https://docs.roots.io/trellis/master/installation/.
Make sure all dependencies have been installed before moving on:
- Virtualbox >= 4.3.10
- Vagrant >= 2.1.0
Windows user? Read the Windows getting started docs for slightly different installation instructions.
The recommended directory structure for a Crellis project looks like:
example.com/ # → Root folder for the project
├── crellis/ # → Your clone of this repository
└── site/ # → A Craft site ([Craft's directory structure](https://docs.craftcms.com/v3/directory-structure.html))
- Create a new project directory:
$ mkdir example.com && cd example.com
- Install Crellis:
$ git clone --depth=1 [email protected]:newtonne/crellis.git && rm -rf crellis/.git
- Install Craft into the
site
directory:
$ composer create-project craftcms/craft site
- Configure your Craft sites in
group_vars/development/craft_sites.yml
and ingroup_vars/development/vault.yml
- Ensure you're in the crellis directory:
cd crellis
- Run
vagrant up
Read the local development docs for more information.
A base Ubuntu 22.04 server (18.04 and 20.04 also supported) is required for setting up remote servers.
- Configure your Craft sites in
group_vars/<environment>/craft_sites.yml
and 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
users
ingroup_vars/all/users.yml
(see the SSH Keys docs)
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=<environment>
Read the remote server docs for more information.
- Add the
repo
(Git URL) of your Craft project in the correspondinggroup_vars/<environment>/craft_sites.yml
file - Set the
branch
you want to deploy (defaults tomaster
)
Deploy a site:
$ ./bin/deploy.sh <environment> <site>
Rollback a deploy:
$ ansible-playbook rollback.yml -e "site=<site> env=<environment>"
Read the deploys docs for more information.
Also, see the Trellis installation documentation.
- Join us on Discord by sponsoring us on GitHub
- Participate on Roots Discourse
- Follow @rootswp on Twitter
- Read the Roots Blog
- Subscribe to the Roots Newsletter