Common Docker Container Commands Reference
Common Docker Container Commands Reference
This post serves as a quick reference for common Docker container commands. The commands are organized in a table format for easy copying and use.
Container Commands
n8n (Workflow Automation Tool)
Create persistent volume:
docker volume create n8n_data
Run container:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
Notes
- The commands above use common best practices for running containers
- Volume mounts (
-v) are used to persist data - Port mappings (
-p) expose container ports to the host - Container names are set using
--namefor easy reference - Remove the
--rmflag if you want the container to persist after stopping
Tips
- Always use meaningful container names for easier management
- Consider using Docker Compose for more complex setups
- Check container logs using
docker logs <container_name> - Use
docker psto list running containers - Use
docker volume lsto list all volumes
Feel free to suggest more container commands to add to this reference!