Skip to content
,

Browser Use Guide: Install the Open Source AI Browser Agent (1.0) and Run It Locally

8–12 minutes
Smiling woman in an office holding a tablet with a BROWSER USE card, hook Browser Use AI that browses

Browser Use is a free, open source AI agent that operates a real web browser for you.

You give it a task in plain English, such as “find the cheapest flight to Goa next Friday” or “collect the prices from these five product pages”, and it opens pages, clicks, types and reads until the job is done.

It is one of the most popular browser-agent projects on GitHub, and version 1.0 changed how it works under the hood. The model now writes small Python snippets that run in one persistent session and control Chrome directly through the Chrome DevTools Protocol (CDP).

You can use it three ways: as a Python library in your own code, as a command-line tool that gives coding agents such as Claude Code or Codex a browser, or as a fully hosted cloud API.

It works with Browser Use’s own models, with OpenAI, Anthropic and Google models, and with local models through Ollama.

This guide shows how to install Browser Use 1.0.8, run your first agent, drive your own Chrome with your logins, use a local model, keep passwords safe, limit which sites the agent can visit, and fix common problems.

It follows the official README and docs as of browser-use 1.0.8 (released 22 November 2026 on PyPI).

TL;DR

  • What: an MIT-licensed AI agent that does tasks in a real browser.
  • Install: uv add 'browser-use==1.0.8' or pip install 'browser-use==1.0.8' (Python 3.11+). Pin the exact version.
  • Sign in: browser-use login saves a Browser Use key, or set BROWSER_USE_API_KEY.
  • Your own browser: Browser('chromium') for a fresh local Chrome, Browser('chrome') for the Chrome you already use.
  • Free and local: pair Browser('chromium') with Ollama at http://localhost:11434/v1.
  • Safety: pass passwords with sensitive_data and limit sites with allowed_domains.

How Browser Use Works

Older browser agents sent the model a screenshot and asked it which button to click. Browser Use 1.0 gives the model a Python REPL instead.

Each step, the model writes a short cell, for example “open a new tab with this URL, click element 41, run this bit of JavaScript”. The REPL runs it on Chrome and sends the output back.

When the model has the answer, it calls finish with the result.

  • Persistent REPL: variables survive between steps, so the agent can collect data across many pages.
  • Raw CDP: it talks to Chrome through the same protocol developer tools use, with helper functions from the browser-harness project.
  • Any LLM: Browser Use’s own models by default, or OpenAI, Anthropic, Google, Groq and local models.
  • Built on Pydantic AI: if you came from 0.x, read the project’s MIGRATING.md because the API changed.

After each run, a judge step asks the model to grade the result against your task and reports success, the reason for any failure, whether a CAPTCHA or prompt injection was spotted, and a few lessons about the sites it visited.

Library, CLI or Cloud?

Option Best for What runs where
Python library Developers building automation into their own app Agent runs in your code; browser local or in the cloud
CLI Giving an existing coding agent (Claude Code, Codex, Cursor and others) a browser Your agent calls Browser Use; browser local or cloud
Fully hosted Cloud API Production jobs at scale Browser Use runs both the agent and the browser

If you just want to try it on your own PC, start with the Python library and a local browser.

Install Browser Use 1.0

You need Python 3.11 or newer. The project strongly recommends pinning the exact version with ==, because releases move fast and can break APIs.

With uv (recommended)

  1. Install uv if you do not have it.
  2. Create a project: uv init --python 3.12 my-agent && cd my-agent
  3. Add the package: uv add 'browser-use==1.0.8'
  4. Sign in once: uv run browser-use login. On a server over SSH, add --device-code to approve from another device.

With pip

python3 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install 'browser-use==1.0.8'
browser-use login

Instead of logging in, you can set BROWSER_USE_API_KEY=bu_... in your environment or a .env file. You only need a Browser Use key for its models, cloud browsers and web search; a fully local setup with your own model does not need one.

Run Your First Agent

Save this as first.py:

from browser_use import Agent

result = Agent('Find the number of stars of the browser-use repo').run_sync()
print(result.final_result())
  1. Run it with uv run python first.py (or python first.py in your venv).
  2. By default this uses the bu-4.0 model on Browser Use’s gateway and a Browser Use Cloud browser, which stops when the run ends.
  3. The cloud browser prints a live-view link so you can watch. Treat that link as private, because anyone with it can control the browser.
  4. When the task is done, the answer prints in your terminal.

In async code use result = await agent.run() instead of run_sync().

Choose Which Browser It Drives

Setting What the agent controls
Browser() A Browser Use Cloud browser (the default)
Browser('chromium') A fresh local Chrome, Chromium or Edge with a temporary profile that is deleted afterwards; headless when there is no display
Browser('chrome') The Chrome you already have open, with your logins. Enable remote debugging once at chrome://inspect/#remote-debugging
Browser('chrome', profile='Work') A new Chrome on a temporary copy of your “Work” profile (sync off)
Browser('chromium', user_data_dir='~/bu-profile') A local browser that keeps its own logins between runs

Other useful options are headless=, executable_path= for a specific browser, and keep_alive=True to keep the same page open between tasks.

Use Other Models, Including Ollama

Pass any supported chat model with llm=:

from browser_use import Agent, Browser, ChatOpenAI

agent = Agent(
    'Find the number of stars of the browser-use repo',
    llm=ChatOpenAI('gpt-6-luna'),      # uses OPENAI_API_KEY
    browser=Browser('chromium'),
)
print(agent.run_sync().final_result())
  • Anthropic and Google: ChatAnthropic and ChatGoogle are built in.
  • Other providers: any Pydantic AI model string, for example llm='groq:llama-3.3-70b-versatile' after pip install 'pydantic-ai-slim[groq]'.
  • Browser Use models: bu-4.0 (default), bu-4.0-mini for cheap simple tasks and bu-4.0-pro for the hardest ones.

Run it free with Ollama

The README’s free route is a local browser plus a local model through Ollama’s OpenAI-compatible endpoint:

llm = ChatOpenAI('qwen3', base_url='http://localhost:11434/v1', api_key='ollama')
agent = Agent('Open example.com and tell me the page title', llm=llm, browser=Browser('chromium'))

Pull the model first (ollama pull qwen3) and keep Ollama running; our Ollama guide covers setup. Small local models handle simple pages but struggle with long, tricky tasks, so start with a larger model if your GPU allows it.

Give Claude Code or Codex a Browser (CLI)

The CLI lets a coding agent you already use browse the web. The README suggests pasting this request into your agent:

  1. Install the tool: uv tool install browser-use==1.0.8
  2. Register the skill: browser-use skill install
  3. Connect it to your browser (local Chrome or a cloud browser).
  4. If setup fails, run browser-use --doctor and follow its output.

Browser Use also offers an MCP server, so MCP clients can call it as a tool. See our list of the best MCP servers for other tools worth adding beside it.

Useful Features: Results, Files, Follow-ups

  • Typed results: Agent(task, output_model_schema=MyModel) returns a Pydantic object in result.structured_output, perfect for scraping into a table.
  • Uploads: put files in the agent’s workspace and name them in the task.
  • Downloads: saved to agent.workspace/downloads; result.downloads lists them.
  • Follow-up tasks: agent.add_new_task('...') then run again, with keep_alive=True to stay on the same page.
  • Custom tools: decorate your own functions with @tools.action('description').
  • Ultrafast mode: mode='ultrafast' acts on accessibility-tree ids for speed.
  • Web search: web_search=True adds a search tool billed to your Browser Use key.
  • Cost tracking: result.usage and result.cost_usd show what a run cost.

Passwords, Site Limits and Safety

Passwords

Never put a password in the task text. Pass it with sensitive_data, optionally tied to a domain:

Agent(task, sensitive_data={'https://*.example.com': {'password': '...'}})

The model types it with type_secret('password') and the value is hidden in logs and results. The docs are clear that this is not a sandbox: model-written code can still read it, and screenshots or a live view can show it.

Limit where it goes

Browser(allowed_domains=['example.com', '*.example.org'])

You can also use prohibited_domains= and block_ip_addresses=True. These guard a well-behaved model but do not filter every request, so run untrusted tasks in a container or VM.

Local debugging port

Browser('chromium') and profile copies open an unauthenticated debugging port on 127.0.0.1. On a shared machine, other local users could attach to that browser and its logins, so use a container or a cloud browser there.

Also respect each site’s terms of service. Automating logins, purchases or bookings on sites that forbid bots can get your account blocked. For a more consumer-style agent that works in its own cloud computer, see our Perplexity Computer guide.

Telemetry

Anonymous usage stats are on by default. Turn them off with ANONYMIZED_TELEMETRY=false or browser-use telemetry disable.

What It Costs

Part Cost
Python library and CLI Free, MIT license
Local browser + local model (Ollama) Free apart from your electricity and hardware
Your own OpenAI, Anthropic or Google key Billed by that provider per token
Browser Use Cloud browser From $0.06 per browser-hour (README), with stealth, CAPTCHA solving and proxies
Browser Use models and web search Usage-based; see the models page in the docs

New sign-ups with Google, GitHub or Microsoft get $1 of cloud credit to try it.

Troubleshooting

Problem Fix
Missing key error Run browser-use login, set BROWSER_USE_API_KEY, or switch to your own model and Browser('chromium')
Login link never opens (SSH, server) Use browser-use login --device-code and approve on another device
Old code breaks after upgrading 1.0 changed the API; read MIGRATING.md, and pin browser-use==1.0.8
Browser('chrome') will not attach Turn on remote debugging at chrome://inspect/#remote-debugging; on Windows close Chrome before using a profile copy
No browser window in Docker or CI Normal: it runs headless when there is no display
Ollama model loops or gives up Use a bigger model, simplify the task, or give exact URLs
Site shows CAPTCHAs or blocks Cloud browsers include a solver and proxies; results still depend on the site
Anything else browser-use --doctor checks the setup and suggests fixes

FAQ

Is Browser Use free?

The library is free and MIT licensed. You pay only for the model and, if you choose it, the cloud browser. A local browser with an Ollama model costs nothing.

Can Browser Use work with Ollama?

Yes. Use ChatOpenAI(model, base_url='http://localhost:11434/v1', api_key='ollama') with Browser('chromium').

Can it use my logged-in accounts?

Yes. Browser('chrome') drives the Chrome you already have open with your logins, or use a profile copy or a saved user_data_dir.

Which Python version do I need?

Python 3.11 or newer.

What changed in Browser Use 1.0?

The agent now writes Python in a persistent REPL that controls Chrome through raw CDP, built on Pydantic AI. Code from 0.x needs updating using MIGRATING.md.

Is there a TypeScript version?

Yes. The project also maintains a TypeScript browser agent, listed in the README’s related repositories.

Is it safe to give it my passwords?

Use sensitive_data so passwords stay out of prompts and logs, limit domains, and run risky tasks in a container. It reduces exposure but is not a full sandbox.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Smiling woman in an office holding a tablet with a BROWSER USE card, hook Browser Use AI that browses