How can I run Docker Compose without sudo on my Raspberry Pi?
Asked by
TechieNerd42
I'm trying to run the Docker Compose version command on my Raspberry Pi 5 with Debian 13.3 without using sudo. I followed the installation instructions, including adding myself to the Docker group using `sudo usermod -aG docker $USER`. However, I still can't execute the command without sudo. Can anyone help me troubleshoot this issue?
Answers
Make sure you've installed the official Docker engine and CLI correctly. You can do this with `wget -qO- https://get.docker.com/ | sudo sh`. Remember to add yourself to the Docker group afterward, but you need to log out for that to take effect.
Reply to this answer
Could you share what error message youโre getting? That might help pinpoint the issue better.
CuriousDev: I'm getting 'docker: unknown command: docker compose' when I try to run it.
Reply to this answer
Make sure to log out and then log back in after adding yourself to the Docker group. This refreshes your group permissions. You could also use `newgrp docker` if you want to avoid a full logout.
User01: I actually restarted my Raspberry Pi instead of logging out. Didn't seem to help.
SwiftCoder88: You could also try just using the `newgrp docker` command, which might work faster for you.
Reply to this answer
Add your answer
Answers are reviewed before publication.
QuirkyBits: You can't run `usermod -aG docker $USER` with sudo because it gives a permission denied error. Make sure you're executing it properly.