Docker Cheat Sheet/Create network with subnet

Create a network with a custom subnet.

Section: Networks

Create network with subnet

bash
bash
docker network create --subnet 172.20.0.0/16 app-net
Explanation

Useful when you need predictable IP ranges.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Networks
Publish a port
Publish a container port to the host.
OpenIn sheetbash1 tag match
Create container without starting
Create a container but do not start it yet.
OpenIn sheetbash1 tag match
Show Docker version
Display client and server version details.
Pull an image
Download an image from a registry.
Run a container
Create and start a new container.
Inspect a container
Show low-level JSON metadata for a container.