> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niteshift.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker support

> Docker-in-Docker is supported. The daemon runs by default, so the setup script and agent can use docker directly.

Niteshift environments ship with a Docker daemon already running. Your setup script and the agent
can run `docker`, `docker compose`, and Dockerfile builds directly. Don't start `dockerd` yourself;
a second daemon will fail with socket conflicts.

## Constraints

### Ephemeral state

By default, Docker's data directory (`/var/lib/docker`) lives on tmpfs. Volumes, pulled images, and
stopped containers do **not** survive across the [task lifecycle](/tasks#lifecycle) (suspend and
resume). Each resume starts from a fresh Docker state and re-pulls images on demand.

Persisting Docker state across the task lifecycle is possible, but comes with performance
trade-offs, so it's opt-in. Email [support@niteshift.dev](mailto:support@niteshift.dev) to enable
it.

### Networking

Docker runs with `--iptables=false`, so containers should use host networking to communicate with
each other and reach the internet. Run containers with `--network=host` (or `network_mode: host` in
compose). Services then talk to each other via `localhost:<port>` and have normal outbound access.

The [setup agent](/environment-configuration/setup-agent) applies this automatically when adapting
an existing compose file during onboarding.
