Docker Commands

Docker Commands

docker compose pull n8n
docker compose pull
docker compose down
docker compose pull
docker compose up -d
# Remove all dangling images (old versions with no tags)
docker image prune
# Remove dangling images with force confirmation
docker image prune -f
# Remove all unused images (not just dangling)
docker image prune -a
# Force remove without confirmation
docker image prune -a -f
# Step 1: Pull latest image
docker compose pull n8n
# Step 2: Restart with new image
docker compose up -d
# Step 3: Remove old n8n images
docker images n8nio/n8n  
# See old versions
docker rmi $(docker images n8nio/n8n -q | tail -n +2)  
# Keep only latest
# Step 4: Clean up dangling images
docker image prune -f
# Remove all stopped containers, unused networks, dangling images
docker system prune
# More aggressive - removes all unused images (not just dangling)
docker system prune -a
# Most aggressive - removes everything including volumes
docker system prune -a --volumes

The docker image prune -f command is usually sufficient and safest for regular cleanup!

Reference