# Free disk space in GitHub Actions: each option, measured

We measured what each way of freeing disk on a GitHub-hosted runner gives, and what it costs in time. Three options free 14 GB in under 40 seconds.

November 22, 2026, by Supercorp.

A job on a private repository's GitHub-hosted runner starts with about 14 GB of free disk, and most of the rest is taken by tools the job may never use. Deleting some of them is the usual way to get room, often with the free-disk-space action. We measured what each option frees and how long it takes, on Ubuntu 24.04 and 26.04, in a private and a public repository, on 22 November 2026.

The short answer: three options free about 14 GB in under 40 seconds; everything frees about 36 GB in four to five minutes; and the swap option frees nothing.

## How much is free when a job starts

| Runner | Disk | Free at the start |
|---|---|---|
| Private repository, Ubuntu 24.04 (2 CPUs) | 75 GB | 13.4 to 16.9 GB |
| Private repository, Ubuntu 26.04 (2 CPUs) | 75 GB | 15.4 GB |
| Public repository, Ubuntu 24.04 (4 CPUs) | 150 GB | 91.5 to 94.9 GB |
| Public repository, Ubuntu 26.04 (4 CPUs) | 150 GB | 93.5 GB |

Free space differs from one runner to the next on the same image, by up to 3.5 GB. GitHub [promises 14 GB](https://docs.github.com/en/actions/reference/runners/github-hosted-runners).

## What takes the space

The largest folders on both images, in GB:

| What | Where | Size |
|---|---|---|
| Android SDK | `/usr/local/lib/android` | 11.3 |
| .NET | `/usr/share/dotnet` | 6.4 |
| Tool cache: Python, Go, Node.js, Ruby, PyPy, CodeQL | `/opt/hostedtoolcache` | 5.3 |
| Haskell | `/usr/local/.ghcup` | 3.7 |
| Swift | `/usr/share/swift` | 3.5 |
| Docker images | `/var/lib/docker` (24.04), `/var/lib/containerd` (26.04) | 2.6 (24.04), 3.5 (26.04) |
| Swap file | `/swapfile` | 3.1 |
| Java | `/usr/lib/jvm` | 1.3 to 1.5 |
| PowerShell | `/usr/local/share/powershell` | 1.4 |
| CodeQL, in the tool cache | `/opt/hostedtoolcache/CodeQL` | 1.4 |
| Miniconda (24.04 only) | `/usr/share/miniconda` | 1.2 |
| Julia (24.04 only) | `/usr/local/julia*` | 1.0 |

The Docker images are pulled in advance for Dependabot and GitHub's agentic workflows (`dependabot-updater-core`, `gh-aw-firewall` and others). On 26.04 they take more room because Docker 29's containerd store keeps each layer twice, compressed and unpacked.

## What each option frees

We ran [`lumbroso-commons/free-disk-space@v2`](https://github.com/lumbroso-commons/free-disk-space) with one option on at a time, then with its defaults, then with everything. Space freed on the root disk, and the time the step took:

| Option | Freed, 24.04 | Freed, 26.04 | Time |
|---|---|---|---|
| `android` | 11.8 GB | 11.9 GB | 57 to 101 s |
| `dotnet` | 6.7 GB | 6.7 GB | 9 to 15 s |
| `preinstalled-runtimes` | 5.6 GB | 5.6 GB | 18 to 49 s |
| `large-packages` | 5.0 GB | 4.8 GB | 59 to 67 s |
| `haskell` | 3.9 GB | 3.9 GB | 2 to 6 s |
| `docker-images` | 2.7 GB | 3.7 GB | 9 to 19 s |
| `swap-storage` | 0 | 0 | 0 to 1 s |
| `dotnet`, `haskell`, `docker-images` | 13.4 GB | 14.4 GB | 16 to 41 s |
| The defaults | 30.2 GB | 31.0 GB | 125 to 174 s |
| Everything | 35.8 GB | 36.6 GB | 216 to 290 s |

The sizes were the same in the private and the public repository; the times varied from runner to runner, more than between images.

What stands out:

- **Android is the most room and the slowest.** 11.8 GB, but it is a great many small files, and deleting them takes a minute or more.
- **.NET, Haskell and the Docker images are the quick ones.** Together about 14 GB in well under a minute: on a private runner, that is room for one more large Docker build.
- **`large-packages` is slow for what it gives.** It removes packages through `apt`, which takes a minute for 5 GB. The action's README calls it "the slow one".
- **`swap-storage` frees nothing.** The action deletes `/mnt/swapfile`, but on today's runners the swap file is `/swapfile`, 3.1 GB, so nothing is deleted. The option still turns swap off, which the action's README warns can kill a job short on memory. To have the 3 GB, both steps are needed: `sudo swapoff -a && sudo rm -f /swapfile` freed 3.2 GB in a second. On one public 24.04 runner, swap was in memory (`zram`) and there was no file to delete.
- **Everything takes four to five minutes.** On a private repository's standard runner, at $0.006 a minute, that is about 3 cents a run, and five minutes of waiting. Freeing more than the job needs costs both.

## The quick version, without the action

Three commands, the same room as the three quick options, in 31 seconds on both images:

```yaml
- name: Free disk space
  run: |
    sudo rm -rf /usr/share/dotnet /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
    docker image prune --all --force
```

It freed 14.8 GB on 24.04 and 15.8 GB on 26.04. Add `/usr/local/lib/android` for 11.8 GB more, at a minute or so; a job that builds for Android should keep it, and a job that uses .NET should keep `/usr/share/dotnet`.

To delete only when needed, check first. The action's README has a step for it, gated on the free space in the workspace:

```yaml
- id: disk
  run: echo "free_kib=$(df -k --output=avail -- "$GITHUB_WORKSPACE" | awk 'NR == 2 {print $1}')" >> "$GITHUB_OUTPUT"
- if: ${{ fromJSON(steps.disk.outputs.free_kib) < 20971520 }}  # under 20 GiB
  run: sudo rm -rf /usr/share/dotnet /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
```

## When that is not enough

Deleting tools gives a private runner about 50 GB at most. Past that:

- **Push Docker images instead of loading them**, and on Ubuntu 26.04 go back to Docker's classic store: [No space left on device in GitHub Actions](/blog/github-actions-no-space-left-on-device) has both.
- **Split the job** so each part has its own runner and its own disk.
- **Use a runner with a larger disk.** GitHub's 4-CPU larger runner has 150 GB, at $0.012 a minute, and needs a Team or Enterprise Cloud plan.

SuperCI, which we make, runs GitHub Actions jobs on fresh machines in your own AWS, Cloudflare or Modal account. The label says how much disk a job gets, and nothing needs deleting first: on AWS, `runs-on: superci/cpu=8/disk=200` gives a job about 180 GB free, for about $0.02 an hour more. [Labels and machines](/docs/labels) has the sizes.

## How we measured

A workflow with a matrix of the two images and each option, run on GitHub's standard runners in a public and a private repository: free space on `/` from `df` before and after the step, and the step's time. Images `ubuntu24/20261116` and `ubuntu26/20261116`. One run of each, so read the times as a range, not a figure.

Related: [every GitHub Actions limit in one place](/blog/github-actions-limits).
