StackVerdict

How to install Aider, step by step

Aider is a free, open-source AI pair programmer that lives in your terminal and edits files directly in your git repo. Every change becomes a commit, so nothing the AI does is lost or hidden. This guide takes you from zero to your first AI-assisted edit in about ten minutes.

What you'll end up with: Aider running in your terminal, connected to a model (DeepSeek for near-free costs, or Claude for top quality), editing a real project.

Before you start

You need three things. Don't worry if you're missing some — we cover each below.

Step 1 — Check that Python is installed

Open your terminal and run:

python --version

If you see something like Python 3.11.4, you're set. If you get an error or a version below 3.8, install a current Python from python.org (Windows/macOS) or your package manager (brew install python on macOS, sudo apt install python3on Ubuntu). On some systems the command is python3 instead of python.

Step 2 — Install Aider

The maintainers recommend a dedicated installer that keeps Aider isolated from your other Python packages, so it can't break them. Run:

python -m pip install aider-install
aider-install

This installs Aider in its own environment and adds the aider command to your path. When it finishes, confirm it worked:

aider --version

You should see a version number print out.

If aider isn't found after installing, close and reopen your terminal so it picks up the updated path. On Windows, use a fresh PowerShell window.

Step 3 — Choose a model and get an API key

Aider needs a model to think with. You bring your own API key, which is why Aider itself is free — you pay only the model provider, and only for what you use. Two popular choices:

Option A — DeepSeek (cheapest)

DeepSeek's coding models are strong and extremely cheap, often a few dollars a month for regular use. Create an account at DeepSeek's platform, add a small amount of credit, and generate an API key from their dashboard.

Option B — Claude (highest quality)

Anthropic's Claude models lead on complex, multi-file work. Costs are higher than DeepSeek but you pay per use. Create a key in the Anthropic console.

Keep your key secret. An API key is like a password that can spend your money. Never paste it into a website, commit it to git, or share it in a screenshot.

Step 4 — Give Aider your key

Set your key as an environment variable so Aider can read it. Replaceyour-key-here with your actual key.

DeepSeek

macOS / Linux:

export DEEPSEEK_API_KEY=your-key-here

Windows PowerShell:

$env:DEEPSEEK_API_KEY="your-key-here"

Claude (Anthropic)

macOS / Linux:

export ANTHROPIC_API_KEY=your-key-here

Windows PowerShell:

$env:ANTHROPIC_API_KEY="your-key-here"

This sets the key for the current terminal session only. To make it permanent, add theexport line to your shell profile (~/.zshrc or ~/.bashrc), or store it in an .env file that Aider reads automatically.

Step 5 — Start Aider in your project

Move into a project folder that's a git repo. If it isn't one yet:

cd my-project
git init

Now launch Aider, telling it which model to use.

With DeepSeek:

aider --model deepseek

With Claude:

aider --model sonnet

Aider starts a chat prompt right in your terminal. It already sees your repo.

Step 6 — Make your first edit

Add the files you want Aider to work on, then just describe the change in plain language.

/add index.html
> Add a dark mode toggle button in the top-right corner

Aider proposes the edit, applies it to the file, and commits it to git with a clear message. Because every change is a commit, you can review it with git diff or undo it withgit revert if you don't like it.

Handy commands inside Aider:/add a file to the chat, /drop to remove one,/undo to reverse the last change, /diff to see what changed, and/help for the full list.

Common problems

"Command not found: aider"

Reopen your terminal, or check that the install step finished without errors.

Authentication or 401 errors

Your key isn't set in this terminal session. Re-run the export command, and make sure you copied the whole key with no trailing spaces.

Aider won't edit a file

Add it to the chat first with /add filename. Aider only edits files it's been given.

Is Aider right for you?

Aider is a fantastic fit if you're comfortable in a terminal and want maximum control at minimum cost — especially paired with DeepSeek. If you'd rather work in a visual editor or skip the setup entirely, other tools may suit you better.

Not sure Aider is your best match?

Answer three quick questions and compare it against every other AI coding stack for your specific build.

Compare stacks →