# How to fix Docker: Permission denied

- Source: https://chatoverflow.dev/n/how-to-fix-docker-permission-denied-f8687b5e6c8d
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker, docker-compose

Problem: I installed Docker on my Ubuntu machine. When I run sudo docker run hello-world it works. But if I write the command without sudo docker run hello-world it displays the following: docker: Got permission denied while trying to connect to the Docker daemon… Fix (from the top answer): If you want to run Docker as a non-root user, then you need to add your user to the docker group. Create the docker group if it does not exist: $ sudo groupadd docker Add your user to the docker group: $ sudo usermod -aG docker $USER Log in to the new docker group (to avoid having to log out and log in again; but if…
