---
source: https://iinventedlight.com/library/notes/docker-compose-networks.md
title: "Compose networks: let services reach each other by name"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker Docs); Apache-2.0 (Docker documentation source); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Docker Docs, Define and manage networks in Docker Compose; Docker documentation source, Compose networks (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-networks"
tags: [docker, compose, networks, dns, services]
client: Librarian
sources:
  - id: S1
    title: "Define and manage networks in Docker Compose"
    publisher: Docker Docs
    url: https://docs.docker.com/reference/compose-file/networks/
    accessed: 2026-11-24
    license: "Apache-2.0"
  - id: S2
    title: "Compose networks (source)"
    publisher: Docker documentation source
    url: https://raw.githubusercontent.com/docker/docs/main/content/reference/compose-file/networks.md
    accessed: 2026-11-24
    license: "Apache-2.0"
---
# Compose networks: let services reach each other by name
**Answer:** Networks let services communicate with each other.

## Named networks

The top-level networks element lets you configure named networks.

Those named networks can be reused across multiple services.

You must explicitly grant each service access with the networks attribute.

If external is true, this network's lifecycle is maintained outside Compose.

## The default network

By default Compose sets up a single network for your app.

Containers stay reachable by other containers on that network.

Each container for a service joins the default network.

Those containers are reachable by other containers on that network.

They are also discoverable by the service's name.

## See also

- [docker-compose-build](https://iinventedlight.com/library/notes/docker-compose-build/)
- [docker-compose-basics](https://iinventedlight.com/library/notes/docker-compose-basics/)
- [docker-network](https://iinventedlight.com/library/notes/docker-network/)

## Claims

- id: C1
  claim: By default Compose sets up a single network for your app.
  source: S1
  evidence: "By default Compose sets up a single network for your app"

- id: C2
  claim: A service container is discoverable by the service name on that network.
  source: S1
  evidence: "discoverable by the service's name"

- id: C3
  claim: Each service container joins the default network.
  source: S1
  evidence: "Each container for a service joins the default network"

- id: C4
  claim: You must grant each service access to a named network under that service.
  source: S2
  evidence: "you must explicitly grant each service access"

## Sources

- [S1] Define and manage networks in Docker Compose. Docker Docs. https://docs.docker.com/reference/compose-file/networks/ . License: Apache-2.0. Accessed 2026-11-24.

- [S2] Compose networks (source). Docker documentation source. https://raw.githubusercontent.com/docker/docs/main/content/reference/compose-file/networks.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 Docs, Define and manage networks in Docker Compose; Docker documentation source, Compose networks (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).
