- Okay, so in this section,
we're gonna download and install the Terraform CLI.
This is one of the easiest software packages
that you'll ever have to install.
There's two main ways to do this.
The first way is to install the CLI
on your laptop or your work station
or whatever you're using.
And then the other way is to do it through docker.
They're both very, very simple.
So let's just go ahead and get started.
So, first we just browse to terraform.io.
This is just the homepage with HashiCorp's website
for Terraform.
And then we simply select download CLI,
and then you'll find your version in here.
I'm running MacOS, so I'm gonna select that.
But you can see that it's supported on FreeBSD, Linux,
OpenBSD, Solaris and Windows.
So we're gonna select MacOS,
and this is gonna download a zip file.
So we'll just tell it to open, go ahead and open that.
Okay, so
this has unzipped the file, and it contains
simply one file called Terraform.
It's a binary executable.
And then we simply have to move this
to someplace in the path.
And you can put this anywhere you like on your file system.
I usually use user local bin, 'cause I'm on a Mac,
and that's a convenient location that's already in my path.
So
we're just going to go to a command line,
and we're gonna move that file.
And it downloaded as Terraform 2
because I already had another copy of Terraform,
but you will probably just see the filename Terraform.
Okay.
So now, Terraform is installed.
Okay, so 12.13, that was the version that we were expecting.
So that's it for installing Terraform.
It's one of the simplest things, it's a single binary.
Very, very simple.
There is another way, though, which is to use docker.
So this is also very common.
Docker is a great way to use Terraform
because it's always going to run in a Linux environment,
and so that's a good way to ensure that
all pathing and everything is consistent.
So if you're on Windows or on Mac,
I think it's a good idea to run Terraform inside a docker.
And so the way to do that
is that you can simply docker pull
HashiCorp.
And you can use latest.
And then once you're a little bit further
into developing your Terraform, you probably
don't wanna use latest.
And so you can specify.
You can see this is the same version, 0.12.13,
this is the same version from the example above.
And we can run it.
Same way we did before.
Okay, and that needs to be qualified.
Okay, so that one worked, that one ran inside a docker.
If we just run
Terraform that's running from the Mac,
and if we run
docker run, then it runs in a docker container.
You can see there's a tiny bit of delay
when we run it in docker, because it has to start a VM
and run it that way.
But I encourage you to run it in docker.
Most of the time, if you're gonna be running this
in a continuous delivery system,
that that's gonna be running inside a docker.
And we will be talking about continuous delivery
in one of the later lessons.