Run a container with a named volume.
Section: Volumes and Mounts
Mount named volume in container
bash
bash
docker run -d --name db -v pgdata:/var/lib/postgresql/data postgres:16Explanation
Common for persistent databases and stateful services.
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 Volumes and Mounts