No space left on device on Ubuntu - Rocketeers app

  [ Rocketeers ](/)   

[Login](https://rocketeersapp.com/login) 

 On this page

 Knowledge
---------

No space left on device on Ubuntu
=================================

### [\#Hosting](https://rocketeersapp.com/knowledge/hosting)

This error means a filesystem is full, or out of inodes. Here is how to find what is eating the disk and reclaim it safely without breaking your server.

 Published by [Mark van Eijk](https://rocketeersapp.com/author/mark-van-eijk) on June 23, 2026 · 1 minute read

1. [About the error](#content-about-the-error)
2. [Find what's full](#content-find-whats-full)
3. [Common culprits and fixes](#content-common-culprits-and-fixes)
4. [Systemd journal logs](#content-systemd-journal-logs)
5. [Application and web server logs](#content-application-and-web-server-logs)
6. [Package cache](#content-package-cache)
7. [Old kernels and Docker](#content-old-kernels-and-docker)

[\#](#content-about-the-error "Permalink")About the error
---------------------------------------------------------

You'll see it from almost any program that tries to write:

 ```
write error: No space left on device

```

It means the filesystem you're writing to is full. Occasionally the disk has free bytes but has run out of **inodes** (the structures that track files), which produces the same message.

[\#](#content-find-whats-full "Permalink")Find what's full
----------------------------------------------------------

Start with a summary of disk usage per filesystem:

 ```
df -h

```

If a filesystem shows 100% but you can't see why, check inodes too:

 ```
df -i

```

Then find the biggest directories on the full filesystem:

 ```
sudo du -h --max-depth=1 / | sort -hr | head -20

```

Drill down into whichever directory is largest by repeating `du` one level deeper.

[\#](#content-common-culprits-and-fixes "Permalink")Common culprits and fixes
-----------------------------------------------------------------------------

### [\#](#content-systemd-journal-logs "Permalink")Systemd journal logs

The journal under `/var/log/journal` can quietly grow to gigabytes. Trim it:

 ```
sudo journalctl --vacuum-time=7d
# or cap by size
sudo journalctl --vacuum-size=200M

```

Cap it permanently in `/etc/systemd/journald.conf`:

 ```
SystemMaxUse=200M

```

### [\#](#content-application-and-web-server-logs "Permalink")Application and web server logs

A runaway log file (nginx, Laravel, a stuck cron) is a classic cause. Truncate it in place rather than deleting it, so the writing process keeps its file handle:

 ```
sudo truncate -s 0 /var/log/nginx/error.log

```

Set up `logrotate` so it can't happen again.

### [\#](#content-package-cache "Permalink")Package cache

On a server that's been updated a lot, the apt cache reclaims gigabytes:

 ```
sudo apt clean
sudo apt autoremove --purge

```

### [\#](#content-old-kernels-and-docker "Permalink")Old kernels and Docker

Old kernels and unused Docker images/volumes are frequent space hogs:

 ```
sudo apt autoremove --purge   # removes old kernels
docker system prune -a        # if you run Docker

```

For more cleanup ideas see [reclaiming disk space on Ubuntu](/reclaim-diskspace-on-ubuntu). If the disk filled because of swap or you have none, see [adding swap space on Ubuntu](/add-swap-space-on-ubuntu).

### Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

  Fill in your email address to receive updates  Subscribe 

#### More in [\#Hosting](https://rocketeersapp.com/knowledge/hosting)

- [How to get top processes with highest memory usage](https://rocketeersapp.com/knowledge/top-processes-memory)
- [How to get top processes with highest CPU usage](https://rocketeersapp.com/knowledge/top-processes-cpu)
- [How to add Swap Space on Ubuntu servers](https://rocketeersapp.com/knowledge/add-swap-space-on-ubuntu)
- [Disable unnecessary and unused PHP versions (FPM pools)](https://rocketeersapp.com/knowledge/disable-unused-php-fpm-pools)
- [Reclaim disk space on Ubuntu server](https://rocketeersapp.com/knowledge/reclaim-diskspace-on-ubuntu)
- [How to check Ubuntu version](https://rocketeersapp.com/knowledge/ubuntu-version)

 [View all 16 articles →](https://rocketeersapp.com/knowledge/hosting)
