# podman network: Container Networking in CI

> podman network creates and manages networks so containers can reach each other by name. Reference for create, connect, the rootless DNS and pasta/slirp notes, and CI errors.

Source: https://latchkey.dev/learn/command-reference/podman-network  
Updated: 2026-06-30

podman network creates user-defined networks so containers can resolve and reach each other by name.

A test app and its database need to find each other. A shared user-defined network gives them DNS by container name, the same model as docker network.

## What it does

podman network creates, lists, inspects, and removes networks. Containers on the same user-defined network resolve each other by name through the built-in DNS (aardvark-dns). Rootless networking uses pasta or slirp4netns for outbound connectivity.

## Common usage

```Terminal
podman network create appnet
podman run -d --name db --network appnet docker.io/library/postgres:16
podman run --rm --network appnet docker.io/library/postgres:16 \
  psql -h db -U postgres -c 'SELECT 1'
podman network ls
podman network rm appnet
```

## Options

| Command/Flag | What it does |
| --- | --- |
| create <name> | Create a user-defined network |
| ls | List networks |
| inspect <name> | Show network configuration |
| connect / disconnect | Attach or detach a container |
| rm <name> | Remove a network |
| --network <name> | Run a container on a specific network |

## In CI

Put cooperating containers on one podman network create so they reach each other by name, rather than relying on host ports. Name-based DNS only works on user-defined networks, not the default one, so always create a network for multi-container tests.

## Common errors in CI

A container that cannot resolve a peer by name is usually on the default network where DNS is off; create a user-defined network and attach both. "could not find pasta ... slirp4netns" in rootless mode means neither rootless network helper is installed; install pasta or slirp4netns. "network ... is being used by container" on rm means a container is still attached; disconnect or remove it first.

## FAQ

### podman network: Container Networking in CI?

A test app and its database need to find each other. A shared user-defined network gives them DNS by container name, the same model as docker network.

### What it does?

podman network creates, lists, inspects, and removes networks. Containers on the same user-defined network resolve each other by name through the built-in DNS (aardvark-dns). Rootless networking uses pasta or slirp4netns for outbound connectivity.

### In CI?

Put cooperating containers on one podman network create so they reach each other by name, rather than relying on host ports. Name-based DNS only works on user-defined networks, not the default one, so always create a network for multi-container tests.

### Common errors in CI?

A container that cannot resolve a peer by name is usually on the default network where DNS is off; create a user-defined network and attach both. "could not find pasta ... slirp4netns" in rootless mode means neither rootless network helper is installed; install pasta or slirp4netns. "network ...

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
