Utiliser le programme d'installation de la Google Cloud CLI
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Google Cloud CLI fournit un programme d'installation pour chaque plate-forme compatible et peut être déployé de manière interactive ou non interactive.
Installation interactive
Le programme d'installation vous permet de télécharger, d'installer et de configurer rapidement la dernière version de Google Cloud CLI en mode interactif. Lorsque vous exécutez le programme d'installation, il télécharge les composants de Google Cloud CLI et les installe sur le système local. Il effectue également d'autres tâches d'installation, telles que l'ajout de composants de la gcloud CLI à votre PATH et l'activation des commandes dans votre interface système.
Linux et macOS
Depuis la ligne de commande, exécutez la commande suivante :
curlhttps://sdk.cloud.google.com|bash
Lorsque vous y êtes invité, choisissez un emplacement sur votre système de fichiers (généralement votre répertoire d'accueil) pour créer le sous-répertoire google-cloud-sdk.
Si vous souhaitez envoyer des statistiques d'utilisation anonymes pour nous aider à améliorer gcloud CLI, répondez Y lorsque vous y êtes invité.
Pour ajouter des outils de ligne de commande gcloud CLI à votre PATH et activer l'achèvement de commande, répondez Y lorsque vous y êtes invité.
Redémarrez votre interface système :
exec-l$SHELL
Pour initialiser l'environnement Google Cloud CLI, exécutez la commande gcloud init :
gcloudinit
Windows (programme d'installation)
Google Cloud CLI fonctionne sous Windows 8.1 et versions ultérieures, et Windows Server 2012 et versions ultérieures.
Lancez le programme d'installation, puis suivez les instructions. Ce programme est signé par Google LLC.
Si vous utilisez un lecteur d'écran, cochez la case Activer le mode Lecteur d'écran. Cette option configure gcloud pour utiliser des outils de suivi d'état au lieu des icônes de chargement Unicode, afficher la progression sous forme de pourcentage et aplatir les tables. Pour en savoir plus, consultez le guide des fonctionnalités d'accessibilité.
Google Cloud CLI nécessite Python. Les versions compatibles sont Python 3.9 à 3.13. Par défaut, la version Windows de Google Cloud CLI est fournie avec Python 3. Pour utiliser Google Cloud CLI, votre système d'exploitation doit pouvoir exécuter une version compatible de Python.
Le programme d'installation installe toutes les dépendances nécessaires, y compris la version Python requise.
Bien que Google Cloud CLI installe et gère Python 3 par défaut, vous pouvez si nécessaire utiliser une installation Python existante. Pour ce faire, décochez l'option "Installer la version incluse de Python".
Pour savoir comment utiliser une installation Python existante, consultez la page gcloud topic startup.
Une fois l'installation terminée, le programme d'installation vous donne la possibilité de créer un menu Démarrer et des raccourcis sur le Bureau, de démarrer le shell de Google Cloud CLI et de configurer gcloud CLI. Veillez à conserver les options pour démarrer le shell et configurer l'installation sélectionnée. Le programme d'installation affiche une fenêtre de terminal, puis exécute la commande gcloud init.
L'installation par défaut n'inclut pas les extensions App Engine requises pour déployer une application à l'aide des commandes gcloud. Ces composants peuvent être installés à l'aide du gestionnaire de composants de gcloud CLI.
Conseils de dépannage :
Si l'installation échoue parce que la commande find n'est pas reconnue, assurez-vous que votre variable d'environnement PATH est définie de façon à inclure le dossier contenant find. Il s'agit généralement de C:\WINDOWS\system32;.
Si vous avez désinstallé gcloud CLI, vous devez redémarrer votre système avant de l'installer à nouveau.
Si la décompression échoue, exécutez le programme d'installation en tant qu'administrateur.
Windows (fichier Zip)
Vous pouvez également installer la dernière version à partir d'un fichier .zip téléchargé :
Téléchargez google-cloud-sdk.zip, puis décompressez son contenu. Pour cela, effectuez un clic droit sur le fichier téléchargé et sélectionnez Tout extraire.
Lancez le script google-cloud-sdk\install.bat, puis suivez les instructions d'installation.
À la fin de l'installation, redémarrez l'invite de commande (cmd.exe).
Vous pouvez automatiser l'installation de Google Cloud CLI à l'aide du script d'installation.
Pour Linux et MacOS :
Enregistrez le script d'installation localement au lieu de le rediriger vers bash.
Saisissez la commande suivante dans une invite :
curlhttps://sdk.cloud.google.com > install.sh
Exécutez le script en transmettant les arguments décrits ci-dessous :
bashinstall.sh--disable-prompts
Les options install.sh sont les suivantes :
--disable-prompts : désactiver les invites.
--install-dir=DIRECTORY : définir le répertoire racine d'installation sur DIRECTORY. Google Cloud CLI est installé dans DIRECTORY/google-cloud-sdk. La valeur par défaut est $HOME.
Pour Windows :
/S : effectuer l'installation silencieusement. Aucune page du programme d'installation n'est affichée. Utilisez les indicateurs pour modifier les paramètres d'installation.
/D : définir le répertoire d'installation par défaut. Il doit s'agir du dernier paramètre utilisé dans la ligne de commande. Il ne peut contenir aucun guillemet, même si le chemin comprend des espaces. Seuls les chemins absolus sont acceptés, par exemple /D=C:\CloudSDK.
/allusers : effectuer l'installation pour tous les utilisateurs
/singleuser : effectuer l'installation pour l'utilisateur actuel (par défaut)
/screenreader : active le mode lecteur d'écran (il est désactivé par défaut).
/reporting : active les rapports d'utilisation (par défaut, les rapports d'utilisation sont désactivés).
/noreporting : désactiver les rapports d'utilisation (par défaut, les rapports d'utilisation sont désactivés)
/nostartmenu : ne pas créer de raccourci dans le menu Démarrer (par défaut, un raccourci est créé)
/nodesktop : ne pas créer de raccourci sur le Bureau (par défaut, un raccourci est créé)
Faites l'essai
Si vous débutez sur Google Cloud, créez un compte pour évaluer les performances de nos produits en conditions réelles. Les nouveaux clients bénéficient également de 300 $ de crédits gratuits pour exécuter, tester et déployer des charges de travail.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[],[],null,["# Using the Google Cloud CLI installer\n\nThe Google Cloud CLI provides an installer for each supported platform and can\nbe deployed interactively or non-interactively.\n\nInteractive installation\n------------------------\n\nThe installer lets you download, install, and set up the latest version of\nGoogle Cloud CLI in an interactive mode. When you run the installer,\nit downloads Google Cloud CLI components and installs them on the local\nsystem. It also performs additional setup tasks like adding gcloud CLI\ncomponents to your `PATH` and enabling command completion in your shell.\n| **Note:** The installer is designed to make it easy for a user to install the latest version of Google Cloud CLI. If you want to use a script to install a specific version in non-interactive mode --- for example, to install the same version automatically every time you build a production system --- use a [versioned archive](/sdk/docs/downloads-versioned-archives) of the Google Cloud CLI.\nLinux and macOS\n\n1. At the command line, run the following command: \n\n ```bash\n curl https://sdk.cloud.google.com | bash\n ```\n2. When prompted, choose a location on your file system (usually your Home directory) to create the `google-cloud-sdk` subdirectory under.\n3. If you want to send anonymous usage statistics to help improve gcloud CLI, answer `Y` when prompted.\n4. To add gcloud CLI command-line tools to your `PATH` and enable command completion, answer `Y` when prompted.\n5. Restart your shell: \n\n ```bash\n exec -l $SHELL\n ```\n6. To initialize the Google Cloud CLI environment, run [`gcloud init`](/sdk/gcloud/reference/init): \n\n ```bash\n gcloud init\n ```\nWindows (Installer)\n\nThe Google Cloud CLI works on Windows 8.1 and later and Windows Server 2012 and later.\n1.\n Download the [Google Cloud CLI installer](https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe).\n\n\n Alternatively, open a PowerShell terminal and run the following PowerShell commands: \n\n ```bash\n (New-Object Net.WebClient).DownloadFile(\"https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe\", \"$env:Temp\\GoogleCloudSDKInstaller.exe\")\n\n & $env:Temp\\GoogleCloudSDKInstaller.exe\n \n ```\n2. Launch the installer and follow the prompts. The installer is signed by Google LLC.\n\n\n If you're using a screen reader, check the **Turn on screen reader mode** checkbox. This\n option configures `gcloud` to use status trackers instead of unicode spinners,\n display progress as a percentage, and flatten tables. For more information, see the\n [Accessibility features guide](/sdk/docs/enabling-accessibility-features).\n3. Google Cloud CLI requires Python; supported versions are Python 3.9 to 3.13. By\n default, the Windows version of Google Cloud CLI comes bundled with Python 3. To use\n Google Cloud CLI your operating system must be able to run a supported version of Python.\n\n\n The installer installs all necessary dependencies, including the needed Python version.\n While Google Cloud CLI installs and manages Python 3 by default, you can use an existing\n Python installation if necessary by **unchecking** the option to Install Bundled Python.\n See [`gcloud topic startup`](/sdk/gcloud/reference/topic/startup) to\n learn how to use an existing Python installation.\n4. After installation is complete, the installer gives you the option to create Start Menu\n and Desktop shortcuts, start the Google Cloud CLI shell, and configure the\n gcloud CLI. Make sure that you leave the options to start the shell and configure your\n installation selected. The installer starts a terminal window and runs the\n [`gcloud init`](/sdk/gcloud/reference/init) command.\n\n5. The default installation doesn't include the App Engine extensions required to deploy an application using `gcloud` commands. These components can be installed using the [gcloud CLI component manager](/sdk/docs/managing-components).\n\n**Troubleshooting tips:**\n\n- If your installation is unsuccessful due to the `find` command not being recognized, ensure your `PATH` environment variable is set to include the folder containing `find`. Usually, this is `C:\\WINDOWS\\system32;`.\n- If you uninstalled the gcloud CLI, you must reboot your system before installing the gcloud CLI again.\n- If unzipping fails, run the installer as an administrator.\nWindows (Zip)\n\nYou can also install the latest version from a downloaded\n`.zip` file:\n\n1.\n Download\n [google-cloud-sdk.zip](https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.zip)\n and extract its contents. (Right click on the downloaded file and\n select **Extract All**.)\n\n2.\n Launch the `google-cloud-sdk\\install.bat` script and follow\n the installation prompts.\n\n3.\n When the installation finishes, restart the command prompt\n (`cmd.exe`).\n\n4. Run [`gcloud init`](/sdk/gcloud/reference/init):\n\n ```\n C:\\\u003e gcloud init\n ```\n\nNon-interactive (silent) deployment\n-----------------------------------\n\nYou can automate Google Cloud CLI installation using the install script.\n\n**For Linux and MacOS:**\n\nSave the install script locally instead of piping it to bash.\n\n1. Enter the following at a command prompt: \n\n ```bash\n curl https://sdk.cloud.google.com \u003e install.sh\n ```\n2. Run the script, passing arguments described as follows: \n\n ```bash\n bash install.sh --disable-prompts\n ```\n\nThe `install.sh` options are:\n\n- `--disable-prompts` - disable prompts.\n- `--install-dir=`\u003cvar translate=\"no\"\u003eDIRECTORY\u003c/var\u003e - set the installation root directory to \u003cvar translate=\"no\"\u003eDIRECTORY\u003c/var\u003e. The Google Cloud CLI is installed in \u003cvar translate=\"no\"\u003eDIRECTORY\u003c/var\u003e`/google-cloud-sdk`. The default is $HOME.\n\n**For Windows:**\n| **Important:** These flags are for the [Windows installer](/sdk/docs/install-sdk) and are case sensitive.\n\n- `/S` - install silently. No installer pages are displayed. Use flags to change install settings.\n- `/D` - set the default installation directory. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported, for example `/D=C:\\CloudSDK`\n- `/allusers` - install for all users\n- `/singleuser` - install for current user (default)\n- `/screenreader` - turn on screen reader mode (default is to turn it off)\n- `/reporting` - enable usage reporting (default is to turn off usage reporting)\n- `/noreporting` - disable usage reporting (default is to turn off usage reporting)\n- `/nostartmenu` - don't create start menu shortcut (default is to create shortcut)\n- `/nodesktop` - don't create desktop shortcut (default is to create shortcut)\n\nTry it for yourself\n-------------------\n\n\nIf you're new to Google Cloud, create an account to evaluate how our\nproducts perform in real-world scenarios. New customers also get $300 in\nfree credits to run, test, and deploy workloads.\n[Get started for free](https://console.cloud.google.com/freetrial)"]]