Local Development with Craft Nitro
Here is how to remove a site from Craft Nitro.
When a project is over, it would be nice to remove a site from the Craft Nitro config. Removing a site from Nitro won’t remove the project files you have stored in your file system. This will only remove the site from the Nitro configuration, and spin down the container dedicated to that project.
The easiest way to do this is to use the nitro remove
command. If you’re inside of a project directory that is managed by Nitro then this command will prompt you to confirm that you want to remove the project in the current working directory.
If, however, you’re not in a project Nitro has configured or just anywhere else in your filesystem, then Nitro will prompt you to specify the project you’d like to remove by selection from a numbered list of projects.
➜ nitro remove
Select a site:
1. craft-starter.nitro
2. craft-widgets.nitro
3. craftquest.nitro
4. downlink.nitro
5. my-first-module.nitro
Enter your selection: 1
Removing craft-starter.nitro
Apply changes now [Y/n]?
Enter the number and then press Return.
What happens behind the scenes is Nitro will remove the project from the Nitro configuration file, and apply those changes.
It does not:
To destroy the container, you will need to run
➜ nitro apply
to apply the changes made in the configuration file. As part of the apply
routine, Nitro will run nitro clean
, which will go through and remove any unused containers.
To remove the database for the project, you need to run nitro db remove
and choose the database container and then the database you want to remove.
➜ nitro db remove
Which database engine?
1. mysql-8.0-3307.database.nitro
2. postgres-13-5432.database.nitro
Enter your selection: 1
Which database should we remove?
1. brad
2. craftquest
3. craftstartagain
4. craftstarter
realrawmilkfacts
Enter your selection: 3
… removing craftstartagain ✓
Removed "craftstartagain" from "mysql-8.0-3307.database.nitro" successfully 💪
You’ve now successfully removed a project from Nitro!
Local Development with Craft Nitro is made up of the following videos: