While setting up Docker plugin within Jenkins one might encounter the following error
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock
dial unix /var/run/docker.sock: connect: permission denied
The following steps will help resolve the error
Add Jenkins user as the root user
sudo usermod -a -G root jenkins
Restart Jenkins application
sudo service jenkins restart