CapRover

CapRover

  • Docs
  • GitHub
  • Slack Group

›Help

Basics

  • Getting Started
  • CaptainDuckDuck Upgrade
  • Captain Definition File
  • Deployment Methods
  • App Configuration
  • Persistent Apps
  • CLI Commands
  • One-Click Apps
  • Complete Webapp Tutorial

Do More

  • Resource Monitoring
  • NGINX Config
  • Service Update Override
  • App Scaling & Cluster
  • Pre-deploy Script
  • Play with CapRover
  • Run Locally
  • Certbot Overrides
  • Custom Themes

Recipes and Tips

  • Sample Apps
  • Zero Downtime
  • Database Connection
  • Best Practices
  • Backup & Restore
  • Static React App
  • Stateless with Persistent data
  • Docker Compose
  • CI/CD Integration

    • Intro
    • Deploy from GitHub
    • Deploy from GitLab

Help

    Server Purchase

    • DigitalOcean
    • OpenStack
  • Disk Clean-Up
  • Firewall & Port Forwarding
  • Troubleshooting
  • Troubleshooting (Pro)
  • Help and Support
Edit

Disk Clean-Up


Docker uses the disk in different ways:

Docker Images

Saving your images: images are compressed files with your built source-code that you deployed to the server. Every time you deploy a new version of your code, Docker builds a new image for the new version and keeps the old image by default. If you want to clean up all "unused" images on your server, run

docker container prune --force
docker image prune --all

Important Note: Use this approach only if you have a Docker registry set up (local or remote). This is due to an existing bug in Docker, see here for more details on the problem and also see the related Docker Issue

Docker Volumes

Volumes, aka "Persistent Directories". When you create an app with persistent data, like a database, you will assign it a persistent directory. When you change the persistent directory, or when you delete your app, you don't need the volumes anymore. Cleaning up orphaned volumes are tricky. If you have a useful volume for an app that is "currently" crashing and not-running, that volume is considered as "orphaned" by Docker :( So, to safely clean up orphaned volumes, first, check to see if all your services are running by:

docker service ls

Under REPLICAS, you should see 1/1, 2/2 and etc. If you see a service that is not running, then do not proceed! Otherwise, go head and clean-up orphaned volumes by:

docker volume prune

Alternatively, you can first list all volumes, and delete only the ones that you don't want:

docker volume ls                          # lists all volumes
docker volume rm volume-name-goes-here    # removes a specific volume
← OpenStackFirewall & Port Forwarding →
  • Docker Images
  • Docker Volumes
CapRover
Docs
Getting Started
Community
TwitterSlack Group
More
GitHubStar
Copyright © 2025 githubsaturn