DEV Community

TJ
TJ

Posted on

Run Claude for FREE Locally (Using Ollama + Claude Code)

Want to use a Claude-like coding assistant without paying API costs?

In this guide, I’ll show you how to run it (step-by-step) locally using Ollama and Claude Code.


🧠 What You’ll Build

  • Local LLM setup (no API cost)
  • Claude-style coding assistant
  • Fully offline workflow (optional)

⚙️ Step-by-Step Setup

1. Install Ollama

Ollama is the engine that runs LLMs locally.

curl -fsSL https://ollama.com/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Verify:

ollama -v
Enter fullscreen mode Exit fullscreen mode

2. Install Claude CLI

Follow:
https://code.claude.com/docs/en/quickstart

If you see claude is not installed, you missed this step.


3. Install Claude Code

npm install -g @anthropic-ai/claude-code
Enter fullscreen mode Exit fullscreen mode

4. Pull a Coding Model

Command :

ollama pull qwen2.5-coder:7b
Enter fullscreen mode Exit fullscreen mode

You will see :

Pull Model


5. Configure Environment

Add to your ~/.bashrc or ~/.zshrc:

export PATH="$HOME/.local/bin:$PATH"
export ANTHROPIC_BASE_URL=http://localhost:11434/v1
Enter fullscreen mode Exit fullscreen mode

Reload:

source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

You will see :

Configure Claude


6. Launch Claude

ollama launch claude
Enter fullscreen mode Exit fullscreen mode

Now Claude will use your local Ollama model.

LaunchClaude

Free Claude Ready to Use

Claude Ready


During my exploration, I got my model was confuse and the answer was not my want.

Confuse


🔄 Try Alternative Models

ollama pull glm-5:cloud
Enter fullscreen mode Exit fullscreen mode

Then:

ollama launch claude
Enter fullscreen mode Exit fullscreen mode

Choose the new model. The New Model was more precise and answer the question well.

NewModel

💻 Example Prompts

Based on the current project purpose that for explain about claude playground, I want you to trigger technical architect skill here to create boiler plate for golang, to create simple, concise and easy to learn. Please also put the README file about this project. Before you write and work for it, I want you to create a terminal wireframe to show me exactly, using the ASCII art, where you can be able to create a terminal wireframe of exactly what it is going to look like for this playground before we do implementation.
Enter fullscreen mode Exit fullscreen mode

If you want to know about the history of the conversation and the project that created by Free Claude, you can the github below

Top comments (0)