# Error response from daemon: network 'my_network' not found: network not found

- **ID:** `docker/network-not-created-before-service`
- **Domain:** docker
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A service or container references a Docker network that has not been created yet, often due to misordered docker-compose or manual creation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Docker 24.0.6 | active | — | — |
| Docker 25.0.3 | active | — | — |
| Docker 23.0.5 | active | — | — |
| Docker Compose 2.24.0 | active | — | — |

## Workarounds

1. **Create the network first: 'docker network create my_network', then start the container. For docker-compose, ensure the network is defined in the networks section. Example:
networks:
  my_network:
    driver: bridge** (90% success)
   ```
   Create the network first: 'docker network create my_network', then start the container. For docker-compose, ensure the network is defined in the networks section. Example:
networks:
  my_network:
    driver: bridge
   ```
2. **If using docker-compose, run 'docker-compose up -d' which automatically creates networks defined in the compose file before starting services.** (95% success)
   ```
   If using docker-compose, run 'docker-compose up -d' which automatically creates networks defined in the compose file before starting services.
   ```

## Dead Ends

- **** — Running 'docker network create my_network' after the container start attempt may cause the container to still fail because it was created before the network was available. (80% fail)
- **** — Using the same network name but with different driver options does not resolve the missing network issue if it hasn't been created. (85% fail)
