This tutorial goes through Deployment Manager using the `gcloud`
command-line tool. Follow the setup steps to prepare your local environment to
use Deployment Manager.

## Create a project

1. In the Google Cloud console, go to the project selector page.

   [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)
2. Select or create a Google Cloud project.

   **Roles required to select or create a project**
   - **Select a project**: Selecting a project doesn't require a specific IAM role---you can select any project that you've been granted a role on.
   - **Create a project** : To create a project, you need the Project Creator role (`roles/resourcemanager.projectCreator`), which contains the `resourcemanager.projects.create` permission. [Learn how to grant
     roles](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).

   > [!NOTE]
   > **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

<br />

## Enable the APIs for the Google Cloud resources that you want to manage

Deployment Manager uses the APIs of other Google Cloud services to
create and manage your resources. To create these resources, you must first
enable the services' APIs for your project.

For this walkthrough, you deploy Compute Engine resources, so
you need to enable the Compute Engine API.


[Enable the Compute Engine API](https://console.cloud.google.com/start/api?id=compute.googleapis.com)

Next, enable Deployment Manager:


[Enable the Deployment Manager API](https://console.cloud.google.com/start/api?id=deploymentmanager)

<br />

## Install Google Cloud CLI

The Google Cloud CLI offers a command-line tool, `gcloud`, that makes interacting
with Deployment Manager easy.

To install gcloud CLI:

1. [Download and authenticate `gcloud`](https://cloud.google.com/sdk/#Quick_Start).

   Alternatively, use
   [Cloud Shell](https://console.cloud.google.com/?cloudshell=true),
   which comes with `gcloud` already installed.
2. Set your project ID.

   Every command requires a project ID. Set a default project ID so you do not
   need to provide it every time. **Remember to replace `myproject` with your
   own project ID**.

       gcloud config set project myproject

3. Set your default zone and region. Some Google Cloud resources require
   a zone or a region, and you can set a default zone or region, similar to a
   default project. To set a default zone or region, use `gcloud config set`.
   In this case, use `us-central1` as the region and `us-central1-f` as the
   zone:

       gcloud config set compute/region us-central1
       gcloud config set compute/zone us-central1-f

## Clone the Deployment Manager GitHub repository

The Deployment Manager GitHub repository contains samples created by
Google and the Deployment Manager community, including the samples used in
this walkthrough.

    git clone https://github.com/GoogleCloudPlatform/deploymentmanager-samples

    # open the samples folder
    cd deploymentmanager-samples/examples/v2/step_by_step_guide

Now that you have set up your environment, you can start creating your
deployment.