---
source: https://iinventedlight.com/library/notes/docker-compose-volumes.md
title: "Docker Compose volumes: named persistent stores shared by services"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker, Inc.); Apache-2.0 (Docker, Inc.); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Compose file reference: volumes; Docker, Inc., volumes.md source. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-compose-volumes"
tags: [docker, compose, volumes, persistent-storage, drivers]
client: Librarian
sources:
  - id: S1
    title: "Compose file reference: volumes"
    publisher: Docker, Inc.
    url: https://docs.docker.com/reference/compose-file/volumes/
    accessed: 2026-11-24
    license: "Apache-2.0"
  - id: S2
    title: "volumes.md source"
    publisher: Docker, Inc.
    url: https://raw.githubusercontent.com/docker/docs/main/content/reference/compose-file/volumes.md
    accessed: 2026-11-24
    license: "Apache-2.0"
---
# Docker Compose volumes: named persistent stores shared by services
**Answer:** Compose treats volumes as persistent stores that the container engine implements.

## Sharing a named volume

Named volumes are configured in the top-level volumes declaration and may be reused across multiple services.

Each service that needs the volume must be granted access on its own volumes list.

Grant access by using the volumes attribute within the services top-level element.

## Creating and configuring them

The docs show a backend and a backup service sharing a volume called db-data.

compose up will create that volume when it is missing.

A bare entry under top-level volumes is enough; the engine then uses its default configuration.

The driver key specifies which volume driver to use, and driver_opts holds driver options.

## See also

- [docker-volumes](https://iinventedlight.com/library/notes/docker-volumes/)
- [docker-volume](https://iinventedlight.com/library/notes/docker-volume/)
- [docker-compose-services](https://iinventedlight.com/library/notes/docker-compose-services/)

## Claims

- id: C1
  claim: Volumes are persistent data stores implemented by the container engine.
  source: S1
  evidence: "persistent data stores implemented by the container engine"

- id: C2
  claim: Named volumes can be reused across multiple services.
  source: S1
  evidence: "named volumes that can be reused across multiple services"

- id: C3
  claim: You must explicitly grant each service access to a shared volume.
  source: S2
  evidence: "explicitly grant each service access"

- id: C4
  claim: An empty top-level volumes entry uses the engine default configuration.
  source: S2
  evidence: "container engine's default configuration"

## Sources

- [S1] Compose file reference: volumes. Docker, Inc.. https://docs.docker.com/reference/compose-file/volumes/ . License: Apache-2.0. Accessed 2026-11-24.

- [S2] volumes.md source. Docker, Inc.. https://raw.githubusercontent.com/docker/docs/main/content/reference/compose-file/volumes.md . License: Apache-2.0. Accessed 2026-11-24.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Compose file reference: volumes; Docker, Inc., volumes.md source. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
