Stay organized with collections
Save and categorize content based on your preferences.
This page describes the steps to install Terraform for
Google Cloud in Cloud Shell 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis guide details the process of installing and configuring Terraform for Google Cloud, both in the online Cloud Shell environment and in a local shell.\u003c/p\u003e\n"],["\u003cp\u003eTo get started, you'll need to create or select a Google Cloud project and ensure that billing is enabled for it.\u003c/p\u003e\n"],["\u003cp\u003eProvisioning Google Cloud resources with Terraform requires enabling the relevant APIs and setting up specific Identity and Access Management roles for your user account.\u003c/p\u003e\n"],["\u003cp\u003eVerify that Terraform is correctly installed and operational by executing the \u003ccode\u003eterraform\u003c/code\u003e command in your terminal.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Shell environment comes pre-configured with Terraform and the gcloud CLI, while local shell users will have to install and initialize them.\u003c/p\u003e\n"]]],[],null,["# Install Terraform\n\nThis page describes the steps to install Terraform for\nGoogle Cloud in [Cloud Shell](/shell/docs) and in a local shell.\nCloud Shell is an interactive shell environment for Google Cloud\nthat lets you learn and experiment with Google Cloud and manage your\nprojects and resources from your web browser.\n\nFor a introductory guide to using Terraform with Google Cloud, see the\n[Terraform for Google Cloud Quickstart](/docs/terraform/create-vm-instance). \n\n### Cloud Shell\n\n\n1. To use an online terminal with the gcloud CLI and Terraform\n already set up, activate Cloud Shell:\n\n At the bottom of this page, a Cloud Shell session starts and\n displays a command-line prompt. It can take a few seconds for the session\n to initialize.\n2. Run the following command to verify that Terraform is available:\n\n terraform\n\n The output should be similar to the following: \n\n\n Usage: terraform [global options] \u003csubcommand\u003e [args]\n\n The available commands for execution are listed below.\n The primary workflow commands are given first, followed by\n less common or more advanced commands.\n\n Main commands:\n init Prepare your working directory for other commands\n validate Check whether the configuration is valid\n plan Show changes required by the current configuration\n apply Create or update infrastructure\n destroy Destroy previously-created infrastructure\n\n3. To use Terraform with Google Cloud, you should ensure the\n following tasks are completed within Google Cloud:\n\n - [Create or have a Google Cloud project](/resource-manager/docs/creating-managing-projects).\n - [Enable billing](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project) for the Google Cloud project.\n - [Enable APIs](/apis/docs/getting-started#enabling_apis) for the Google Cloud services you intend to work with.\n - [Set up authentication](/docs/terraform/authentication) for Terraform.\n\n### Local shell\n\n1. Use the [installation instructions](https://developer.hashicorp.com/terraform/tutorials/gcp-get-started/install-cli)\n provided by Terraform.\n\n2. Run the following command to verify that Terraform is available:\n\n terraform\n\n The output should be similar to the following: \n\n\n Usage: terraform [global options] \u003csubcommand\u003e [args]\n\n The available commands for execution are listed below.\n The primary workflow commands are given first, followed by\n less common or more advanced commands.\n\n Main commands:\n init Prepare your working directory for other commands\n validate Check whether the configuration is valid\n plan Show changes required by the current configuration\n apply Create or update infrastructure\n destroy Destroy previously-created infrastructure\n\n3. To use Terraform with Google Cloud, you should ensure the\n following tasks are completed within Google Cloud:\n\n - [Create or have a Google Cloud project](/resource-manager/docs/creating-managing-projects).\n - [Enable billing](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project) for the Google Cloud project.\n - [Enable APIs](/apis/docs/getting-started#enabling_apis) for the Google Cloud services you intend to work with.\n - [Set up authentication](/docs/terraform/authentication) for Terraform.\n\nWhat's next\n-----------\n\n- Work through the [Terraform for Google Cloud quickstart](/docs/terraform/create-vm-instance)\n- Learn about the [basic Terraform commands](/docs/terraform/basic-commands)."]]