← All guides

Locus product guide · Updated

How to self-host Firecrawl with Docker Compose

To self-host Firecrawl, clone its open-source repository at a pinned release, write a small .env file and run docker compose up --build -d. That starts the Firecrawl API on port 3002, with Playwright, Redis, RabbitMQ and PostgreSQL beside it. Firecrawl's guide pins release v2.11.162 and checks the install with one real scrape. The default stack serves scrape, crawl, map and search; Agent, Interact and Alexandria stay on Firecrawl Cloud. If an agent only needs hosted Firecrawl calls, Locus Pro runs them per call with no Firecrawl account.

Setup, step by step

  1. Step 1

    Install the prerequisites

    Firecrawl's guide needs Git, Docker Engine or Docker Desktop, Docker Compose v2 (run as docker compose) and curl. Port 3002 must be free, and Docker needs enough CPU, memory and disk to build and run several services.

  2. Step 2

    Clone the pinned release

    The guide is verified against release v2.11.162. Check out that tag so the code, commands and Compose file match. For another release, read its docker-compose.yaml first.

    git clone https://github.com/firecrawl/firecrawl.git
    cd firecrawl
    git checkout v2.11.162
  3. Step 3

    Write a minimal .env file

    Create it in the repository root. Replace the password with at least 32 random characters and do not commit the file. Keep POSTGRES_DB=postgres, because the bundled pg_cron setup targets that database. Authentication stays off for this first run.

    cat > .env <<'EOF'
    USE_DB_AUTHENTICATION=false
    POSTGRES_USER=postgres
    POSTGRES_PASSWORD=replace-with-at-least-32-random-characters
    POSTGRES_DB=postgres
    EOF
  4. Step 4

    Build and start the stack

    Compose builds the checked-out source and starts every service in the background. Warnings about unset optional variables are expected. The API and its services should show as running, and the one-shot setup services as completed.

    docker compose up --build -d
    docker compose ps --all
  5. Step 5

    Check that the API answers

    The readiness route should return {"status":"ok"}. It only shows the API is up; it does not test Redis, PostgreSQL, RabbitMQ, Playwright or outbound access.

    curl \
      --fail \
      --silent \
      --show-error \
      --max-time 5 \
      http://localhost:3002/health/readiness
  6. Step 6

    Scrape one page end to end

    A response with success set to true and a markdown field means the API, the scraping pipeline and outbound access all work. No API key or Authorization header is needed while authentication is off.

    curl \
      --fail-with-body \
      --silent \
      --show-error \
      --max-time 75 \
      -X POST \
      http://localhost:3002/v2/scrape \
      -H 'Content-Type: application/json' \
      -d '{
        "url": "https://example.com",
        "formats": ["markdown"],
        "timeout": 60000
      }'
  7. Step 7

    Stop it when you finish testing

    Keep the evaluation stack on a trusted network and shut it down when you are done. If a service fails to start, docker compose logs --tail=200 shows why.

    docker compose down

What do you need to self-host Firecrawl?

Firecrawl's self-hosting guide asks for Git, Docker Engine or Docker Desktop, Docker Compose v2 and curl, with port 3002 free. Firecrawl does not publish a verified minimum host size. The Compose file at v2.11.162 gives the API container up to 4 CPUs and 8 GB of memory, and the docs say those limits are not verified minimums.

The code is mostly under the AGPL-3.0 license, with the SDKs and some UI components under MIT. Self-hosting gives you control of the source and the servers, and your team runs upgrades, security, storage, monitoring and recovery.

At this release, Compose runs the services below. Only the API is published to the host, on port 3002.

What do you need to self-host Firecrawl?
ServiceRole in the stack
API and workersServe the v2 API and run scrape, crawl and other jobs
Playwright serviceRenders pages that need a browser, with a basic fetch fallback
RedisIn-memory store the API uses, including for rate limiting
RabbitMQMessage broker for the job queue
NuQ PostgreSQLThe default job queue and its database
FoundationDBAn optional queue backend, used only when NUQ_BACKEND=fdb is set

How do you configure a self-hosted Firecrawl?

Settings go in the .env file at the repository root. It overrides only variables that docker-compose.yaml references, and Firecrawl's docs say apps/api/.env.example is for API development, not a drop-in Compose file. Get one scrape working, then change one setting at a time.

Compose builds Firecrawl from source by default. Comments in the file point to prebuilt images under ghcr.io/firecrawl if you would rather pull than build, and SELF_HOST.md recommends an exact release tag, because main and floating image tags can change independently.

Search on a self-hosted instance uses your own SearXNG server when SEARXNG_ENDPOINT is set. Without it, the code at v2.11.162 falls back to DuckDuckGo results.

How do you configure a self-hosted Firecrawl?
SettingWhat it controlsQuickstart value
USE_DB_AUTHENTICATIONWhether requests need an API keyfalse, so no key or Authorization header
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DBCredentials for the queue databaseYour own password; keep POSTGRES_DB=postgres
OPENAI_API_KEY, OPENAI_BASE_URL, MODEL_NAME, OLLAMA_BASE_URLAn OpenAI-compatible provider or Ollama for LLM-backed formats such as JSON extractionNot set
PROXY_SERVER, PROXY_USERNAME, PROXY_PASSWORDA proxy for page requests from the browser serviceLeft empty
SEARXNG_ENDPOINTA SearXNG instance for the search routeUnset, so search falls back to DuckDuckGo
NUM_WORKERS_PER_QUEUE, CRAWL_CONCURRENT_REQUESTS, MAX_CONCURRENT_JOBS, BROWSER_POOL_SIZEWorkers and concurrencyCompose defaults of 8, 10, 5 and 5
NUQ_BACKENDThe job queue backendUnset, which means PostgreSQL
BULL_AUTH_KEYAdmin routes and the queue UIUnset, so those routes are off

What does self-hosted Firecrawl include compared with Cloud?

Firecrawl's open source and Cloud comparison says both paths expose the core APIs. The difference is who configures, secures and runs the services around them. The table follows its docs on December 2, 2026.

What does self-hosted Firecrawl include compared with Cloud?
CapabilitySelf-hosted default stackFirecrawl Cloud
Scrape, crawl, map and search APIsIncludedIncluded and managed
Fetch and Playwright renderingIncluded in the default stackManaged
LLM-backed extraction and formatsConnect an OpenAI-compatible provider or OllamaManaged provider path
Fire-engine and advanced anti-bot handlingRun and configure that service separatelyManaged where Cloud supports it
Screenshots and page actionsNeed Fire-engine; fetch and Playwright report no supportAvailable on scrape
Agent, Browser, Interact and dashboardsNot in the default stackIncluded by product and plan
Alexandria data providersNot included; the providers run on CloudIncluded, priced per tool
Security, storage, uptime and upgradesYour team runs themFirecrawl runs them
Usage and billingYour infrastructure and provider costsFirecrawl plans and credits

What should you add before running it in production?

The Compose quickstart is meant for a trusted network. Firecrawl's docs list these decisions before the API serves real traffic, and note that no single .env switch covers them.

For larger deployments, the repository has Kubernetes manifests and a Helm chart under examples/kubernetes. SELF_HOST.md calls them versioned starting points, so the same decisions still apply.

  • A complete authentication design, TLS at a reverse proxy or ingress, and network rules before anyone outside a trusted network can reach the API.
  • Persistent volumes, backups and tested restores for PostgreSQL, Redis and RabbitMQ. The root Compose file defines no persistent volumes for them.
  • Monitoring, resource sizing, scaling triggers, and upgrade and rollback steps if you have uptime or capacity targets.
  • A map of data flows to target sites and to any model, proxy or parsing provider you turn on, when data location or compliance matters.
  • The database password in your platform's secret manager instead of .env.
  • A strong BULL_AUTH_KEY and restricted network access if you turn on the admin routes and queue UI.

Is there a lighter way to run Firecrawl locally?

Yes. Firecrawl Local is one binary that scrapes, crawls and maps from your own machine, with no database, queue or container. Install it with cargo install firecrawl-local, which needs Rust and a C compiler. It renders JavaScript pages in the Chrome or Chromium already on your machine.

Running firecrawl-local serve answers the Firecrawl v2 API on port 3002, so code written for Firecrawl runs against it unchanged. Running firecrawl-local init adds it as an MCP server to Claude Code, Claude Desktop, Cursor, Windsurf, Gemini CLI and Codex.

Search, pages that refuse your machine, and Alexandria go to Firecrawl Cloud by default; set FIRECRAWL_CLOUD=off to keep everything local. Local scrapes skip the json and summary formats and ignore browser actions, and crawl jobs are held in memory until serve stops.

When does the hosted Firecrawl API suit better?

Firecrawl recommends starting with Firecrawl Cloud unless source access or infrastructure control is worth the operational work. Cloud suits teams that want nothing to run, need Agent, Interact, Browser, Monitor or Alexandria, or want one account for usage and support.

You can try it without an account. Firecrawl's scrape and search endpoints and its MCP server at https://mcp.firecrawl.dev/v2/mcp work without an API key at lower rate limits. The free plan adds 1,000 credits a month with no card, and a scrape uses 1 credit per page. Prices checked December 2, 2026.

Self-hosting is the better pick when you need the code on your own servers, want to change it, or want every request to run from infrastructure you control.

Can an agent use hosted Firecrawl without running anything?

Yes. If you need Firecrawl calls but not your own servers, Locus Pro sells Firecrawl's own scrape, crawl, map and search per call. An agent calls hosted Firecrawl with no Firecrawl account or key and nothing to operate, and each call is charged in credits from one prepaid balance that also pays for Tavily, DataForSEO, language models and other providers. Catalog checked December 2, 2026.

Controls sit on the account: a monthly hard limit that stops new calls, a max charge on any call, spend and low-balance alerts, and agent keys with per-call and per-run credit limits. Connect the hosted MCP server at https://api.paywithlocus.com/api/credits/mcp, or use the CLI, REST API or SDK.

The Locus catalog had no Firecrawl Interact, Agent, Monitor or Alexandria endpoints on that date, and Locus Pro is a hosted service, not open source. For those, or for Firecrawl on your own servers, use Firecrawl Cloud or the self-hosted stack.

Can an agent use hosted Firecrawl without running anything?
Locus endpointWhat it does
firecrawl/scrape-v2One page as markdown, or JSON from a prompt or schema
firecrawl/scrapeOne page in markdown or other formats
firecrawl/crawlPages across a site, following links up to a limit you set
firecrawl/batch-scrapeMany URLs in one job
firecrawl/mapThe URLs on a site, without their content
firecrawl/searchWeb search with scraped content from top results

Frequently asked questions

Is self-hosted Firecrawl free?

The code is free to run under the AGPL-3.0 license. Firecrawl's comparison lists the cost of the open-source path as your own infrastructure plus any providers you connect, such as a model API or a proxy, rather than Firecrawl credits.

Does self-hosted Firecrawl need an API key?

Not in the quickstart. USE_DB_AUTHENTICATION=false turns API authentication off, so requests need no key or Authorization header. Firecrawl's docs say to add a complete authentication design, TLS and network controls before the API leaves a trusted network.

Can I point the Firecrawl SDKs and CLI at my own instance?

Yes. The SDKs take an API URL such as http://localhost:3002, and Firecrawl's self-hosting guide says to point the Firecrawl CLI or the local MCP server at your instance's API URL once a test scrape works.

Does self-hosted Firecrawl include Alexandria?

No. Alexandria's data providers run on Firecrawl Cloud and are not part of the self-hosted server. Firecrawl Local can reach them after you sign in with firecrawl-local login and a free Firecrawl account.

Can I run Firecrawl on Kubernetes?

Yes. The repository includes Kubernetes manifests and a Helm chart under examples/kubernetes. Firecrawl calls them versioned starting points, so authentication, storage, monitoring and scaling are still your decisions.

Implementation references

Use these first-party references for current request contracts and account requirements. Tool availability, prices, and negotiated terms can change.

Sources

Third-party details were checked on December 2, 2026. Vendors change pricing and features often, so confirm on their site before you decide.

Related guides