List and unlist DDEV

User
get all ddev projects in ubuntu and then unlist
Assistant
Alright!
You want two things on Ubuntu:

1. **List all DDEV projects**
2. **Unlist (remove) them from DDEV's list** (without deleting the project folders themselves)

Here’s exactly how you can do it:

### Step 1: List all DDEV projects

ddev list

You'll see something like:

NAME         TYPE     LOCATION                         STATUS
project1     php      /home/username/projects/project1 running
project2     wordpress /home/username/projects/project2 stopped
...

### Step 2: Unlist (remove) each project

DDEV keeps project registration in `~/.ddev/global_config.yaml` and `~/.ddev/homeadditions`.

✅ The clean way is to run for each project:

ddev stop projectname
ddev delete projectname --omit-data --omit-snapshot

**Explanation:**

– `ddev stop projectname`: Stops it if running
– `ddev delete projectname –omit-data –omit-snapshot`:
– Only unlists the project
– Doesn't touch your database or project files
– **Safe**

### Full Script to *Unlist All* Automatically

If you want to *list and unlist* everything automatically, here’s a quick bash script:

#!/bin/bash

# List all DDEV projects, excluding the header, and get the project names
projects=$(ddev list --simple | awk 'NR>1 {print $1}')

for project in $projects; do
  echo "Unlisting project: $project"
  ddev stop "$project"
  ddev delete "$project" --omit-data --omit-snapshot
done

echo "All projects unlisted from DDEV!"

Save this as `unlist_all_ddev.sh`, then:

chmod +x unlist_all_ddev.sh
./unlist_all_ddev.sh

### Important
– This **only removes the DDEV registration**, not your actual project code or database.
– If you want to **completely destroy everything including database**, you have to omit `–omit-data`.

Would you also like me to give a one-liner version (without script)?
It would do everything in **just one command** if you prefer faster! 🚀
Want it?

Leave a Comment

Your email address will not be published. Required fields are marked *