Codespace Out of Storage: How to Free Disk Space
Quick answer
Each codespace has limited disk. Clear apt caches, find large files, and prune Docker data from the terminal.
Most likely fix: Safe cleanup (terminal)
How to fix it
Try these in order — the most common fix is first.
1. Safe cleanup (terminal)
- sudo apt autoremove
- sudo apt clean
- sudo find / -printf '%s %p\n'| sort -nr | head -10 to find the 10 largest files
- Delete build artifacts and logs
Did this fix it?2. More destructive options
- docker system prune (add -a for all images, --volumes for volumes)
- git clean -i, reviewing carefully since it deletes untracked files
Did this fix it?
Symptoms
The codespace runs out of disk space as it fills over time.
Why it happens
- Limited storage per codespace
- Build artifacts, logs, unused packages and Docker images accumulate
This guide also covers
- codespace out of storage
- codespaces no space left on device
- codespaces disk full
Still not working?
If GitHub Codespaces keeps failing, you're not alone. See every GitHub Codespaces problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other GitHub Codespaces errors
- Codespace Running in Recovery Mode: "This codespace is currently running in recovery mode due to a container error"
- GitHub Codespaces Creation Failed
- Can't Create a Codespace: No Option to Create on the Repository
- GitHub Codespaces "503 Service Unavailable" Error
- Codespaces "Oh no, it looks like you are offline" and Other Connection Errors
- GitHub Codespaces Port Forwarding Not Working
- Codespaces Included Usage Used Up: Core Hours and Storage Quota
- Codespaces Prebuild Not Working: "Prebuild Ready" Label Missing