Using Trellis to Provision and Deploy to DigitalOcean Droplets
DigitalOcean can be easily used with Trellis, and WordPress sites hosted on a $5 DigitalOcean droplet can handle quite a bit with Trellis and FastCGI caching.
# Create/start a development environment
$ vagrant up
# Provision a remote server
$ ansible-playbook server.yml -e env=production
# Deploy WordPress site
$ ./bin/deploy.sh production example.com
Read the docs
Trellis uses Vagrant to automatically create a self-contained virtual machine. Stop cluttering up your host machine with software like MAMP and use the same software you would in production.
You’ll get a complete WordPress server running all the software you need configured according to the best practices. All of this is powered by Ansible for configuration management. You don’t have to use brittle and confusing Bash scripts or worry about commands you found to copy and paste.
Trellis is all about development & production parity. What does this mean? Your development virtual machine and your production are as similar as possible.
This gives the confidence to know that if your WordPress site works in development, it will also work in production and you can deploy with confidence.
Trellis does atomic deploys where the server will git clone
the latest codebase, create a new timestamped release folder, run composer install
, and then update the current
symlink to the latest release. Your webserver will always be serving the latest code on each deployment.
Can’t believe I have gone without Trellis this long, stoked to get a LEMP stack up and running with a dummy domain under 10 minutes.
Setting up WordPress infrastructure always felt like I was being punished. Trellis has solved that problem.
I’ve been using Trellis for a while with a lot of success. All my sites are hosted on DigitalOcean, so using Trellis + DO means I have perfect parity between my dev and production environments.
If you’re doing WordPress—and if so, my thoughts are with you—then check out Trellis, a config-managed LEMP stack.
If you have to pass off a project to someone else, it’s way easier just to say “here is a repository, it contains all of the configuration necessary to get a Vagrant virtual machine up and running with one command”
Trellis runs on Ubuntu 18.04 LTS (Bionic Beaver) based servers and installs the following software:
Our SSL implementation scores an A+ on the Qualys SSL Labs Test. Automatic Let’t Encrypt integration for a free SSL certificate. Trellis gives you the best HTTPS configuration with performance optimizations that include:
Learn more about SSL in Trellis
Trellis manages your SSH keys so users can easily and securely connect to servers and deploy.
Just configure your usernames and tell Trellis to load local SSH key files or provide a GitHub username and it will automatically add all your public keys.
Learn more about SSH keys in Trellis
Get the benefits of caching without the hassle of cache invalidation.
Nginx FastCGI “micro” caching can be configured with a toggle and an optional timeframe. Your WordPress site can be “Reddit proof” just by having a 5 second cache.
Help support our open-source development efforts
Join over 6,000 subscribers on our newsletter to get the latest Roots updates, along with occasional tips on building better WordPress sites.
Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?
“Easily the best WordPress email I get.” Colin OBrien