Install Gemini CLI on Linux

Complete guide for installing Gemini CLI on various Linux distributions.

Ubuntu / Debian / Linux Mint

1. Update package list:

sudo apt update

2. Install Node.js and npm:

# Install Node.js 18.x

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

sudo apt install nodejs

3. Install Gemini CLI:

sudo npm install -g @google/gemini-cli

4. Verify installation:

gemini --version

Fedora / RHEL / CentOS

1. Install Node.js:

# For Fedora

sudo dnf install nodejs npm

# For RHEL/CentOS 8+

sudo dnf module enable nodejs:18

sudo dnf install nodejs npm

2. Install Gemini CLI:

sudo npm install -g @google/gemini-cli

Arch Linux / Manjaro

1. Install Node.js and npm:

sudo pacman -S nodejs npm

2. Install Gemini CLI:

sudo npm install -g @google/gemini-cli

Install Using NVM (Recommended)

Node Version Manager (nvm) allows you to install Node.js without sudo:

1. Install nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Reload shell configuration

source ~/.bashrc

2. Install Node.js:

nvm install node

nvm use node

3. Install Gemini CLI:

npm install -g @google/gemini-cli

Fix npm Permissions (Alternative to sudo)

If you want to avoid using sudo for npm installations:

# Create a directory for global packages

mkdir ~/.npm-global

# Configure npm to use the new directory

npm config set prefix '~/.npm-global'

# Add to PATH (add to ~/.bashrc or ~/.zshrc)

export PATH=~/.npm-global/bin:$PATH

# Reload shell configuration

source ~/.bashrc

Common Issues

EACCES permission denied

Use the npm permissions fix above or install with nvm

Command not found: gemini

Add npm global bin directory to PATH:

echo 'export PATH="$(npm bin -g):$PATH"' >> ~/.bashrc

source ~/.bashrc

Old Node.js version

Update Node.js to version 16 or higher using nvm or your package manager

Next Steps

Excellent! Gemini CLI is now installed on your Linux system. Configure your API key to start using it: