Before the installation of the gcloud
CLI, confirm that Python 3 is installed. Python 3.5 or higher, 3.7 is recommended.
Follow the following steps to install the Google Cloud CLI:
Download one of the following tarball depending on your hardware name. If you don’t know what your hardware name is, run the uname -m
command:
Open the downloaded tar.gz
file to extract the content of the tarball at any location (the home directory is recommended).
Note: To replace the existing installation, delete all content of the
google-cloud-sdk
directory and extract the content in thegoogle-cloud-sdk
directory.
gcloud
From the root folder, run the following command to execute the installation script:
./google-cloud-sdk/install.sh
To install google-cloud-cli
non-interactively, set all preferences as flags. Use the --help
flag with the above command to see all preferences.
Note: Use the
--screen-reader=true
flag with the above command to turn on the screen reader mode while installation.
gcloud
Use the following command to initialize the gcloud
CLI:
./google-cloud-sdk/bin/gcloud init
gcloud
components (optional)Use the following command to install the additional components of gcloud
:
gcloud components install [COMPONENT_ID]
For example, use the following command to install the AppCtl
component:
gcloud components install appctl
Similarly, update
and remove
keywords can be used instead of install
to update and remove the gcloud
components.