Let's look at using the gcloud command to create a project. gcloud is part of the Google Cloud SDK. You will need to download and install it on your machine in order to use the gcloud commands from your terminal. Alternatively, you may use the cloud shell console from within the browser. Go to https://cloud.google.com/sdk/downloads to download the relevant package as it applies to your machine and install it:
- Once you have installed the SDK on your machine, we need to initialize it. This is done by running the gcloud init command to perform the initial setup tasks. If you ever need to change a setting or create a new configuration, simply re-run gcloud init.
- Open the terminal on your machine and type gcloud init. This opens a browser to allow you to log in to your account. If you want to avoid the browser, type gcloud init --console-only.
- If you use the -console-only flag, then copy and paste the browser URL in the terminal and then copy the key back into the console:
- Enter the numeric choice for the project to use. To create new project, type 2:
- Enter a unique project ID and click Enter. This will create a new project.
- To list all projects, type gcloud projects list: