124 文字
1 分
How to run docker commands without sudo (2025)
TIPA quick memo on how to use the docker command without sudo — I keep forgetting the exact steps, so writing it down.
Overview
Docker is handy for machine learning development. After installing it though, commands like docker ps often fail with a permission error. Since I keep forgetting the steps to run docker without sudo, I’m leaving them here as a personal note.
Prerequisites
- Docker is already installed
Steps
# Create the docker group if it doesn't existsudo groupadd docker
# Add the current user to the docker groupsudo gpasswd -a $USER docker
# Restart the docker daemon (CentOS 7 case)sudo systemctl restart docker
# Log out and log back in to apply the changesexitWrap up
Make docker easier to use and enjoy your dev life!
How to run docker commands without sudo (2025)
https://yurudeep.com/posts/devenv/2025/20251227/en/