Tutorial failed at terraform apply

Ran through the tutorial to this step and it failed. Here is the message I get:

Error: Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/_ping”: dial unix /var/run/docker.sock: connect: permission denied

on main.tf line 10, in provider “docker”:
10: provider “docker” {}

I am running on Linux Ubuntu and I have sudo rights as my user for Docker.

Please help me get past this step…

  • Sean

You can try simply:
sudo terraform plan

You shouldn’t run Terraform as root. Instead you need to ensure that your user is in the docker group to allow access to the Docker socket.