prune

Remove stale Docker images and stopped containers in Kamal deployments.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/donnfelker/kamal-skills --skill prune-donnfelker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prune
Source: https://github.com/donnfelker/kamal-skills/tree/main/skills/prune
Command: npx skills add https://github.com/donnfelker/kamal-skills --skill prune-donnfelker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill solves the issue of disk space exhaustion on servers caused by the accumulation of old, unused Docker images and stopped containers generated during the Kamal deployment lifecycle.

Core Features & Use Cases

  • Automated Cleanup: Provides commands to safely remove unused images and stopped containers while respecting retention policies.
  • Retention Management: Allows users to configure exactly how many previous releases are kept on the server to balance disk usage with rollback availability.
  • Use Case: When a server is running low on disk space after multiple redeployments, use this skill to safely purge stale layers without affecting the current production environment.

Quick Start

Ask the agent to prune all unused images and stopped containers to free up disk space on the server.

Frequently Asked Questions about prune

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I free up disk space from old Docker containers after multiple Kamal redeployments?

To free up disk space from old Docker containers after Kamal redeployments, you can use an automated cleanup process that safely removes unused images and stopped containers while respecting retention policies to preserve rollback availability.

What is the best way to clean up unused Docker images on a Kamal deployment server?

The best way to clean up unused Docker images on a Kamal deployment server is to prune stale, unreferenced container layers and images, which optimizes server storage capacity without affecting the current production environment.

Can I configure how many previous Kamal releases are kept during container pruning?

Yes, you can configure how many previous Kamal releases are kept during container pruning by setting the retain_containers configuration key, which ensures a specified number of recent releases remain available for rollback.

Why does my server run out of disk space when using Kamal for application deployments?

Your server runs out of disk space during Kamal deployments because the deployment lifecycle accumulates old, unused Docker images and stopped containers on the server over time, which eventually exhausts available storage.

Does pruning stopped Docker containers affect my current production environment in Kamal?

No, pruning stopped Docker containers does not affect your current production environment in Kamal, because the cleanup process implements retention logic to preserve recent releases while only targeting stale, unreferenced container layers.