INSTALLING CLAUDE CODE
Claude Code is the client. It's where you type. Ollama is the server. It's where the thinking happens. Now we install the client.
The Installer
Anthropic provides a simple installer:
curl -fsSL https://claude.ai/install.sh | bash
Run this on your WORKSTATION (not the Ollama server, unless they're the same machine).
Successful Output
You should see:
Setting up Claude Code...
✔ Claude Code successfully installed!
Version: 2.1.30
Location: ~/.local/bin/claude
Next: Run claude --help to get started
✅ Installation complete!
Version number will vary.
Update Your PATH
The installer puts claude in ~/.local/bin. This might not be in your PATH by default.
Add to your ~/.zshrc (or ~/.bashrc):
export PATH="$HOME/.local/bin:$PATH"
export COLORTERM=truecolor
Then reload:
source ~/.zshrc
Verify Installation
claude --version
Should show the version number.
Do NOT Run It Yet
Don't run "claude" yet! We need to configure it first.
If you do run it, it will try to connect to Anthropic's cloud and ask for login credentials. That's not what we want.
Configuration - Two Methods
We recommend setting up BOTH methods for reliability. Environment variables take priority, but the settings file serves as a backup.
Method 1: Environment Variables in ~/.zshrc
Add these to your ~/.zshrc:
# Claude Code + Local Ollama
export ANTHROPIC_BASE_URL="http://10.0.0.79:11434"
export ANTHROPIC_AUTH_TOKEN="ollama"
export ANTHROPIC_MODEL="qwen3-coder-32k"
export ANTHROPIC_SMALL_FAST_MODEL="qwen3-coder-32k"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
export API_TIMEOUT_MS="600000"
Replace 10.0.0.79 with YOUR Ollama server IP. Use localhost if Ollama runs on the same machine.
Replace qwen3-coder-32k with YOUR configured model name (the one you created with the Modelfile, not the base model).
Then reload:
source ~/.zshrc
Method 2: Settings File
Create ~/.claude/settings.json:
mkdir -p ~/.claude
nano ~/.claude/settings.json
Paste this:
{
"env": {
"ANTHROPIC_BASE_URL": "http://10.0.0.79:11434",
"ANTHROPIC_AUTH_TOKEN": "ollama",
"ANTHROPIC_MODEL": "qwen3-coder-32k",
"ANTHROPIC_SMALL_FAST_MODEL": "qwen3-coder-32k",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"API_TIMEOUT_MS": "600000"
}
}
Save and exit (Ctrl+O, Enter, Ctrl+X in nano).
Same customization: replace IP and model name to match your setup.
Summary
At this point:
[ ] Claude Code installed at ~/.local/bin/claude
[ ] PATH updated to include ~/.local/bin
[ ] COLORTERM=truecolor in your shell profile
[ ] ANTHROPIC environment variables in ~/.zshrc
[ ] settings.json created in ~/.claude/
[ ] NOT YET running Claude Code
Next chapter: Understanding what each setting does.