

If it worked, you should see a lovely message from Docker:Īgain, all credit for this solution goes to this great AskUbuntu answer I found. To test, try this: docker run hello-world You should now be able to run Docker without sudo. From here you have two options: either logout and then log back in, or run newgrp docker for the changes to take effect. Change the user name to match your preferred user if you do not want to use your current user: sudo gpasswd -a $USER dockerģ. Add the connected user “$USER” to the docker group. Add the Docker group if it doesn’t already exist:Ģ.I discovered this solution on AskUbuntu after encountering the problem.
#RASPBERRY PI CREATE NEW SUDO USER HOW TO#
How to set up Docker to run without using sudo all the time This can be fixed, but it’ll take a few more lines. One small issue, though, is that you might experience difficulty running Docker commands without sudo. This means that the commands will run one after the other, but can be typed on the same line. Now you have Docker installed, and the installation only took two lines.Īs you just saw, the two commands above are chained together using the ‘&’ operator. The two commands can be chained together to form a statement like: curl -fsSL -o get-docker.sh & sh get-docker.sh The first command will be consuming this URL, looking for a file called get-docker.sh.

Installing Docker can be handled by a bash script which will automate the entire installation. Yes, you heard right! With just two lines you can load and install Docker. The silver lining, however, is that there is a handy trick hidden away in the Docker docs detailing how to install Docker with just two lines in the terminal. By Ryan Gordon The easy way to set up Docker on a Raspberry Piĭocker is a very useful tool for running containerized versions of popular applications (such as databases) or setting up some IoT service on an internet-connected device.īut installing Docker can sometimes be a hassle if it needs to be done a number of times across different computers.
