If you'd like to experiment with [Terraform](https://www.terraform.io) on macOS locally, a great provider for doing so is the [Docker provider](https://www.terraform.io/docs/providers/docker/index.html). You can get set up in a few simple steps, like so: ## 1. Install Docker [Install Docker for Mac](https://docs.docker.com/docker-for-mac/install/) if you have not already. ## 2. Install Terraform Grab the latest Terraform for macOS from [releases.hashicorp.com](https://releases.hashicorp.com/terraform/) and place the `terafform` binary somewhere in your `PATH` or you can install with Homebrew: ``` brew install terraform ``` ## 3. Configure, Plan & Apply! Start with a basic NGINX Docker container definition in a minimal Terraform configuration — create a `main.tf` file, and add this to it: ```hcl # Configure Docker provider and connect to the local Docker socket provider "docker" { host = "unix:///var/run/docker.sock" } # Create an Nginx container resource "docker_container" "nginx" { image = "${docker_image.nginx.latest}" name = "enginecks" ports { internal = 80 external = 80 } } resource "docker_image" "nginx" { name = "nginx:latest" } ``` Save the file, then apply the configuration: ``` terraform plan ``` If the plan is good and without error, apply it: ``` terraform apply ``` Check to see that the container is running: ``` docker ps -a ``` The output should have something like this: ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 41911ec0df6f 6b914bbcb89e "nginx -g 'daemon ..." 5 seconds ago Up 4 seconds 0.0.0.0:80->80/tcp, 443/tcp enginecks ``` Now visit [http://localhost](localhost) in your browser and you should see the **Welcome to nginx!** default page!