This issue can occur if Docker is not installed or if the user is not added to the Docker group.
Check if Docker is installed.
Run the following command:
docker info
Sample output:
Client: Context: default Debug mode: false Servers: default: Host: localhost Engine: Version: 20.10.14 API version: 1.44 Go version: go1.17.15 Git commit: 8668127 Built: Thu Apr 1 06:02:55 2021 OS/Arch: linux/amd64 Experimental: false Kernel: 5.15.0-52-generic Operating System: Ubuntu 22.04.1 LTS Total Memory: 31.8GiB CPUs: 8
If you see this output, Docker is installed, but the user may not be added to the Docker group.
Check if the user is in the Docker group.
Run the following command:
grep -i docker /etc/group
Sample output:
docker:x:999:root,$USER1,$USER2,etc
1️⃣ Verify if your username is listed.
If not, add the user to the Docker group.
Add user to the Docker group:
sudo usermod -aG docker $USER
Example
sudo usermod -aG docker Michael
2️⃣ Verify the user is added by re-running the group check:
grep -i docker /etc/group
The output should now include your username, e.g.:
docker:x:999:root,michael
3️⃣ Reboot the server.
sudo reboot
4️⃣Restart Docker.
sudo systemctl restart docker
Now run docker info once again to validate. If you're still experiencing issues, you may need a fresh install of the docker application.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article