# Free Space from Docker container.

The below commands are useful to free up space from containers leave unused images, volumes, networks, logs.  
From the cli where there is Docker installed run the below commands.

##### Commands

```bash
docker image prune -f -a
docker system prune --volumes -f -a
find /var/lib/docker/containers/ -type f -name "*.log" -delete
```

##### Download script

Or you can download the below shell script and add a Cron Job to run every 1 hour.

Download : **[docker-freeup-space.sh](https://docs.greenhome.stream/attachments/10 "Docker Free up Space")**

##### Cron Job

Run crontab to add the job.

```bash
crontab -e
```

Then go to the end of the lines and add the below.

```
0 * * * * /path-of-the-script/docker-freeup-space.sh
```

Save and Exit

Done.

<span style="color: rgb(224, 62, 45);">**Ins0mniA**</span>