Skip to content

cmd clean

github-actions[bot] edited this page Aug 26, 2026 · 5 revisions

nself clean

Remove Docker resources associated with the current ɳSelf project.

Synopsis

nself clean [flags]

Description

By default, nself clean removes generated artifacts scoped to the current ɳSelf project: docker-compose.yml, generated nginx/sites/ config files, the .nself/cache/ build cache, and Docker's build cache. Other Docker projects on your machine are not affected.

nself clean does not delete your .env files, data directories, or any user data. Docker volumes and container data are preserved. To also remove Docker volumes and other project state, use nself reset instead.

With --all, clean additionally runs a host-wide docker system prune --all, removing unused containers, unused networks, unused images, and build cache for every Docker project on the machine, not just this one. Named volumes are never touched by --all; there is no flag on nself clean that deletes volumes.

Because --all affects Docker resources outside the current project, it prompts for confirmation before running: type yes to proceed, anything else (including piping in empty input) cancels. Pass --yes alongside --all to skip the prompt for scripted or CI use.

Flags

Flag Default Description
--all false Also run a host-wide 'docker system prune' affecting every Docker project on this machine (destructive; requires confirmation)
--yes false Skip the --all confirmation prompt (for CI/CD)
--help, -h Show help

Examples

# Project-scoped cleanup (default, recommended)
nself clean

# Also prune Docker resources across the whole machine (prompts for confirmation)
nself clean --all

# Same, skipping the confirmation prompt (CI/CD)
nself clean --all --yes

What is preserved:

  • .env and all .env.* variant files
  • data/ and volumes/ directories
  • Docker volumes and container data, on the default path and with --all

What is removed by default:

  • docker-compose.yml and generated nginx/sites/ config files
  • The .nself/cache/ build cache
  • Docker build cache

What --all additionally removes, host-wide:

  • Stopped containers from every Docker project on the machine
  • Unused networks
  • Unused images (not just images tagged to this project)
  • Build cache from every project

See Also

Commands | Home

Home


Getting Started


Commands


Features


Configuration


Plugins (87 + 10 monitoring)

Free (25)
Pro (62)
Planned (26)
  • plugin-audit
  • plugin-blog
  • plugin-checkout
  • plugin-commerce
  • plugin-drm
  • plugin-export
  • plugin-flow
  • plugin-import
  • plugin-ldap
  • plugin-mailgun
  • plugin-media
  • plugin-oauth-providers
  • plugin-pages
  • plugin-postmark
  • plugin-rate-limit
  • plugin-reports
  • plugin-saml
  • plugin-scheduler
  • plugin-sendgrid
  • plugin-sso
  • plugin-subscription
  • plugin-thumb
  • plugin-transcoder
  • plugin-twilio
  • plugin-waf
  • plugin-watermark

Guides


Architecture


Reference


Licensing


Security


Brand


Operations


Contributing


Admin


Changelog


All commands (52)

Clone this wiki locally