How to clean up provisioned, deployed and deleted websites?

Hi guys,

I’m using Trellis and Bedrock to provision and deploy WordPress websites, and so far it works out great. I’m wondering about one thing though. How do I keep my Digital Ocean droplet clean?


  1. Add website and its credentials to wordpress_sites.yml and vault.yml
  2. Provision server and deploy website
  3. Remove and its credentials from wordpress_sites.yml and vault.yml
  4. Re-provision server (without credentials)

Now, when I SSH into my server I can still see the nginx configuration files in /etc/nginx/sites-available, the folders in /srv/www/ and the database of Is it weird I expected to see these files removed? If not, how can or should I clean these files up?

Thanks in advance,

Dave van Hoorn

1 Like

No, I’d probably expect that as well. It’s actually never come up until now. I have a feeling people don’t remove sites too often.

It’s not very easy to dynamically remove things via Ansible. Here’s one existing place we do it:

It’s not nice :frowning: I suggest just manually deleting folders/confs/databases.

Allright, I’ll manually remove the files. Thanks for getting back to me.

Could you maybe provide steps what/where/how to manually delete the files, without resorting to full purge of the box?

I guess rm -rf /srv/www/<SITE> would be the first step. How to delete databases for old sites?

Thanks in advance!