> 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` हटाता है **सभी अनउपयोगी इमेजेस को**, सिर्फ “डैंगलिंग” वालों को नहीं।\
इसमें कैश की गई इमेजेस भी शामिल हैं जो आप भविष्य में तेज़ डिप्लॉयमेंट के लिए रखना चाह सकते हैं।
{% endhint %}

***

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

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

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

```bash
docker container prune
```

### इमेजेस (अनउपयोगी)

केवल डैंगलिंग लेयर्स हटाएँ:

```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. पहले क्रमिक (incremental) क्लीनअप को प्राथमिकता दें:
   * `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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
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=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
