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

0
5
Asked By TechieNerd42 On

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?

3 Answers

Answered By HelpfulTommy On

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.

Answered By DockerDude123 On

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.

Answered By LinuxGuy99 On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.