Getting Error while applying "Terraform Apply" command

Hi All,
I am a newbie in terraform, I am trying to install terraform in my free tier EC2 instance. I am following the below link to install terraform.

all commands works well till terraform apply, After i am applying terraform apply, i am getting the below error

Error: Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

│ with provider[“Terraform Registry”],
│ on main.tf line 10, in provider “docker”:
│ 10: provider “docker” {}

I even checked if docker daemon is working , and checked its status but after running status command, i can see the error “Failed to get D-Bus connection: Operation not permitted”.

Please help!!, because of this i am not able to proceed further.

Hi @arpita.dhawan!

It seems that Docker was not set up correctly. Are you able to run the Docker commands in the CLI without errors?
I.e., docker ps ?

If no, I suggest thoroughly following the official Docker installation guide to set it up properly: Install Docker Engine | Docker Documentation

Please let me know if that helped!