How to force a Craft CMS to perform Garbage Collection on DDEV

In terminal, on a DDEV instance that is up and running which is set to a craftcms project type, run ddev craft gc.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 08/07/2023 at 10:38
Last Updated on 08/07/2023 at 12:35
<p>Two flowers that represent Craft CMS and DDEV side by side. Beneath them sits the text "Force Garbage Collection."</p>

In terminal, on a DDEV instance that is up and running which is set to a craftcms project type, run ddev craft gc.

SubscribeCraft CMS & DDEV: A Quick Start Guide (2022)

Step One: Start the Craft CMS instance

<p>A screenshot of terminal showing you what happens when you run ddev start.</p>

In Terminal, with the current directory set to that of your project, run:

ddev start

Please note that for this tutorial to work, your DDEV instance must be configured to a craftcms project type.

To configure DDEV to be a Craft CMS instance run ddev config, and complete the process. Once complete run ddev start.

Craft CMS & DDEV: A Quick Start Guide (2022)

Step Two: Force Garbage Collection

<p>A screenshot of Terminal showing what happens when you force garbage collection.</p>

Run the following line to force garbage collection:

ddev craft gc

You can also force hard-deletion for all soft-deleted rows with the delete-all-trashed option:

ddev craft gc --delete-all-trashed=1
Learn more about Craft CMS Garbage Collection

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe