This page describes the steps to install Terraform for
Google Cloud in [Cloud Shell](https://docs.cloud.google.com/shell/docs) and in a local shell.
Cloud Shell is an interactive shell environment for Google Cloud
that lets you learn and experiment with Google Cloud and manage your
projects and resources from your web browser.

For a introductory guide to using Terraform with Google Cloud, see the
[Terraform for Google Cloud Quickstart](https://docs.cloud.google.com/docs/terraform/create-vm-instance).

### Cloud Shell


1. To use an online terminal with the gcloud CLI already set up,
   activate Cloud Shell:

   At the bottom of this page, a Cloud Shell session starts and
   displays a command-line prompt. It can take a few seconds for the session
   to initialize.
2. To install the Terraform CLI, follow the
   [HashiCorp instructions](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/install-cli).

   You can
   [customize your environment](https://docs.cloud.google.com/shell/docs/configuring-cloud-shell#environment_customization)
   to install the Terraform CLI on environment startup, or install the
   binary to your home directory to persist the install between sessions.
3. Run the following command to verify that Terraform is available:

       terraform

   The output should be similar to the following:


       Usage: terraform [global options] <subcommand> [args]

       The available commands for execution are listed below.
       The primary workflow commands are given first, followed by
       less common or more advanced commands.

       Main commands:
         init          Prepare your working directory for other commands
         validate      Check whether the configuration is valid
         plan          Show changes required by the current configuration
         apply         Create or update infrastructure
         destroy       Destroy previously-created infrastructure

4. To use Terraform with Google Cloud, you should ensure the
   following tasks are completed within Google Cloud:

   - [Create or have a Google Cloud project](https://docs.cloud.google.com/resource-manager/docs/creating-managing-projects).
   - [Enable billing](https://docs.cloud.google.com/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project) for the Google Cloud project.
   - [Enable APIs](https://docs.cloud.google.com/apis/docs/getting-started#enabling_apis) for the Google Cloud services you intend to work with.
   - [Set up authentication](https://docs.cloud.google.com/docs/terraform/authentication) for Terraform.

### Local shell

1. Use the [installation instructions](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/install-cli)
   provided by Terraform.

2. Run the following command to verify that Terraform is available:

       terraform

   The output should be similar to the following:


        Usage: terraform [global options] <subcommand> [args]

       The available commands for execution are listed below.
       The primary workflow commands are given first, followed by
       less common or more advanced commands.

       Main commands:
         init          Prepare your working directory for other commands
         validate      Check whether the configuration is valid
         plan          Show changes required by the current configuration
         apply         Create or update infrastructure
         destroy       Destroy previously-created infrastructure

3. To use Terraform with Google Cloud, you should ensure the
   following tasks are completed within Google Cloud:

   - [Create or have a Google Cloud project](https://docs.cloud.google.com/resource-manager/docs/creating-managing-projects).
   - [Enable billing](https://docs.cloud.google.com/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project) for the Google Cloud project.
   - [Enable APIs](https://docs.cloud.google.com/apis/docs/getting-started#enabling_apis) for the Google Cloud services you intend to work with.
   - [Set up authentication](https://docs.cloud.google.com/docs/terraform/authentication) for Terraform.

## What's next

- Work through the [Terraform for Google Cloud quickstart](https://docs.cloud.google.com/docs/terraform/create-vm-instance)
- Learn about the [basic Terraform commands](https://docs.cloud.google.com/docs/terraform/basic-commands).