81 lines
1.4 KiB
Markdown
81 lines
1.4 KiB
Markdown
# Docker Volumes
|
|
|
|
## Purpose
|
|
|
|
Docker volumes store persistent data outside of containers.
|
|
|
|
Containers can be deleted and recreated without losing data stored in volumes.
|
|
|
|
## Why Volumes Matter
|
|
|
|
A container is temporary.
|
|
|
|
A volume contains the important data.
|
|
|
|
Example:
|
|
|
|
* Delete container = service disappears
|
|
* Keep volume = data remains
|
|
* Recreate container = service returns with data intact
|
|
|
|
## Current Volumes
|
|
|
|
| Volume | Purpose |
|
|
| -------------- | --------------------------------- |
|
|
| uptime-kuma | Monitoring data |
|
|
| portainer_data | Portainer configuration |
|
|
| gitea_data | Git repositories, users, settings |
|
|
|
|
## Commands
|
|
|
|
List volumes:
|
|
|
|
```bash
|
|
docker volume ls
|
|
```
|
|
|
|
Inspect a volume:
|
|
|
|
```bash
|
|
docker volume inspect VOLUME_NAME
|
|
```
|
|
|
|
Example:
|
|
|
|
```bash
|
|
docker volume inspect uptime-kuma
|
|
```
|
|
|
|
## Real World Example
|
|
|
|
Uptime Kuma stores:
|
|
|
|
* Monitors
|
|
* Notifications
|
|
* Settings
|
|
* Historical uptime data
|
|
|
|
inside its Docker volume.
|
|
|
|
If the container crashes, the data remains.
|
|
|
|
## Lessons Learned
|
|
|
|
* Containers are disposable.
|
|
* Volumes contain important data.
|
|
* Backups should focus on volumes.
|
|
* Persistent services should always use volumes.
|
|
* Volumes make upgrades and migrations easier.
|
|
|
|
## Backup Strategy
|
|
|
|
Important volumes to back up:
|
|
|
|
* gitea_data
|
|
* uptime-kuma
|
|
* portainer_data
|
|
|
|
## Date Created
|
|
|
|
June 15, 2026
|