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

Oscar de la Hera Gomez
Two flowers that represent Craft CMS and DDEV side by side. Beneath them sits the text "Force Garbage Collection."

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

Step One: Start the Craft CMS instance

A screenshot of terminal showing you what happens when you run ddev start.

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.

Step Two: Force Garbage Collection

A screenshot of Terminal showing what happens when you force garbage collection.

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

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.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details