How can I run Docker Compose without sudo on my Raspberry Pi?

January 10, 2026 3 answers
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

LinuxGuy99
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.

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.

Reply to this answer
DockerDude123
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
HelpfulTommy
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.

Related Discussions