UniSite Documentation Center

Automated Markdown Deployment Matrix Calculating...

How to Install Gemini CLI on Linux

A comprehensive step-by-step setup and deployment guide

Table of Contents


Installing the official Google Gemini CLI (an open-source AI agent for your terminal) on Linux is quick and straightforward. Because it is a Node.js-based application, you just need a compatible Node environment configured on your system.

Step 1: Install Prerequisites (Node.js)

The Gemini CLI requires Node.js version 20.0.0 or higher.

If you are using a Debian/Ubuntu-based system, the default package manager versions might be outdated. Using NVM (Node Version Manager) or the NodeSource repository is highly recommended.

  1. Run the NVM installer:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
    
  2. Restart your terminal or source your profile configuration:

    source ~/.bashrc
    

    (Or use source ~/.zshrc depending on your active shell)

  3. Install and switch to Node 20+:

    nvm install 20
    nvm use 20
    

Option B: Using Ubuntu/Debian Package Manager

Alternatively, you can pull the LTS binaries directly from NodeSource:

sudo apt update && sudo apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

Step 2: Install Gemini CLI

Once Node.js and npm are properly configured, you can install the CLI package globally on your system.

sudo npm install -g @google/gemini-cli

Alternative (No-Install Method): If you just want to evaluate or try out the CLI tool without permanently installing it to your system paths, you can leverage npx to execute it instantly on demand:

npx @google/gemini-cli

Step 3: Launch and Authenticate

To initialize the setup and start the CLI runtime environment, simply execute:

gemini

Authentication Options

Upon your very first launch sequence, the CLI tool will prompt you to choose an interface theme and complete your authentication. You have two main pathways:


Quick Usage Examples

Once completely configured, you can query and leverage the AI agent directly inside your pipeline infrastructure:


Google Gemini CLI Documentation | 2026