> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/clore.ai/clore.ai-eng-hi/for-hosts/server-offline-on-clore.ai/docker-disk-space-cleanup.md).

# Docker डिस्क स्पेस क्लीनअप

## Docker डिस्क स्पेस क्लीनअप (होस्ट्स)

होस्ट मशीनों पर Docker डेटा समय के साथ बढ़ता जाता है।\
पुराने रेंटल्स के बाद रुके हुए कंटेनर, अप्रयुक्त इमेज, वॉल्यूम और बिल्ड कैश रह जाते हैं।\
अगर आप इसे साफ़ नहीं करते, तो रूट डिस्क भर जाती है और डिप्लॉयमेंट्स विफल होने लगते हैं।

{% hint style="info" %}
क्लीनअप केवल तभी चलाएँ जब सर्वर **रेंट पर न हो** और आपको किसी पुराने कंटेनर डेटा की आवश्यकता न हो।\
अगर आप सुनिश्चित नहीं हैं, तो यहीं रुकें और पहले डिस्क उपयोग की जाँच करें।
{% endhint %}

***

## 1) डिस्क उपयोग जाँचें

### OS-स्तर की डिस्क स्पेस (`df -h`)

यह प्रत्येक माउंट किए गए फाइलसिस्टम पर उपलब्ध खाली स्थान दिखाता है।

```bash
df -h
```

आप मुख्य रूप से ध्यान देते हैं `/` (root) और उस पार्टीशन पर जो `/var/lib/docker`.

### Docker-स्तर का डिस्क उपयोग (`docker system df`)

यह दिखाता है कि Docker क्या स्टोर कर रहा है और कितना स्थान पुनः प्राप्त किया जा सकता है।

```bash
docker system df
```

यदि आप प्रति इमेज/कंटेनर अधिक विवरण चाहते हैं:

```bash
docker system df -v
```

***

## 2) पूर्ण क्लीनअप (अनुशंसित)

यह “पिछले रेंटल्स के Docker अवशेषों को रीसेट करने” वाला कमांड है।\
यह अप्रयुक्त कंटेनर, इमेज, नेटवर्क, और **अप्रयुक्त वॉल्यूम**.

```bash
docker system prune -a --volumes
```

{% hint style="warning" %}
`-a` हटाता है **सभी अप्रयुक्त इमेज**, केवल “dangling” वाली नहीं।\
इसमें कैश्ड इमेज भी शामिल हैं जिन्हें आप भविष्य के तेज़ डिप्लॉयमेंट के लिए रखना चाह सकते हैं।
{% endhint %}

***

## 3) व्यक्तिगत क्लीनअप कमांड्स (अधिक नियंत्रण)

इनका उपयोग तब करें जब आप किसी विशिष्ट श्रेणी को साफ़ करना चाहते हों।\
ये क्रमिक रखरखाव के लिए अधिक सुरक्षित हैं।

### कंटेनर (केवल रुके हुए)

```bash
docker container prune
```

### इमेज (अप्रयुक्त)

केवल dangling लेयर्स हटाएँ:

```bash
docker image prune
```

सभी अप्रयुक्त इमेज हटाएँ (उसी जोखिम के साथ जैसे `system prune -a`):

```bash
docker image prune -a
```

### वॉल्यूम (अप्रयुक्त)

```bash
docker volume prune
```

### नेटवर्क (अप्रयुक्त)

```bash
docker network prune
```

***

## 4) होस्ट रखरखाव के लिए सर्वोत्तम प्रथाएँ

1. सफाई करें **रेंटल्स के बीच** या नियोजित डाउनटाइम के दौरान।
2. एक सुरक्षा बफर रखें।\
   लक्ष्य रखें **10–20 GB** हर समय रूट डिस्क पर खाली।
3. Docker उपयोग की नियमित रूप से जाँच करें:
   * `df -h`
   * `docker system df`
4. पहले क्रमिक क्लीनअप को प्राथमिकता दें:
   * `docker container prune`
   * `docker image prune`
   * `docker volume prune`
5. पूर्ण क्लीनअप का उपयोग केवल तभी करें जब ज़रूरत हो:
   * `docker system prune -a --volumes`
6. यदि डिस्क उपयोग तेज़ी से बढ़ता रहता है, तो जाँच करें:
   * रेंटर्स द्वारा बनाए गए बड़े वॉल्यूम।
   * लॉग्स `/var/lib/docker/containers/*/*.log`.
   * बार-बार इमेज रीबिल्ड से बना बिल्ड कैश।


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.clore.ai/clore.ai/clore.ai-eng-hi/for-hosts/server-offline-on-clore.ai/docker-disk-space-cleanup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
