Skip to main content

How to Self-Host Firecrawl with Docker

· 4 min read
Yassine El Haddad
Software Developer & Automation Specialist

I build production AI agents, web scrapers, and automation pipelines. Most of what I publish here comes from the actual problems they run into: proxies that get banned, anti-bot stacks that fingerprint your client, RAG that drifts when the underlying data moves. Stack: Python, TypeScript, Go, FastAPI, LangChain, Crawlee, Playwright, deployed on AWS, GCP, and Cloudflare.

Self-hosting Firecrawl with Docker gives you a local crawl-to-markdown API. The official repo provides docker-compose and images. This guide walks through setup and when to use Firecrawl Cloud instead.

Prerequisites

  • Docker and Docker Compose
  • 8 GB RAM minimum — API (8 GB) + Playwright (4 GB) + Redis, RabbitMQ, Postgres
  • 20+ GB disk for images and data

For production, use a Liquid Web VPS with 16 GB RAM. See Docker on Liquid Web.

Step 1: Clone and Configure

git clone https://github.com/mendableai/firecrawl.git
cd firecrawl

Create .env from the template:

cp apps/api/.env.example .env

Edit .env:

# Required
PORT=3002
HOST=0.0.0.0
USE_DB_AUTHENTICATION=false

# Change this if deployment is public
BULL_AUTH_KEY=CHANGEME

Optional:

# AI features (/extract, JSON format)
OPENAI_API_KEY=sk-...

# Proxy for scraping
PROXY_SERVER=http://proxy.example.com:8080

Step 2: Build and Run

docker compose build
docker compose up

Services:

  • api — Main API on port 3002
  • playwright-service — Browser rendering (Chromium)
  • redis — Caching and rate limiting
  • rabbitmq — Message queue
  • nuq-postgres — Data storage

The API is available at http://localhost:3002.

Step 3: First API Call

Scrape a single URL:

curl -X POST http://localhost:3002/v2/scrape \
-H 'Content-Type: application/json' \
-d '{"url": "https://example.com"}'

Crawl with recursion:

curl -X POST http://localhost:3002/v2/crawl \
-H 'Content-Type: application/json' \
-d '{"url": "https://docs.firecrawl.dev"}'

Step 4: Queue Admin UI

With BULL_AUTH_KEY set, view the Bull queue panel at:

http://localhost:3002/admin/{BULL_AUTH_KEY}/queues

Self-Hosted vs Cloud

FeatureSelf-hostedCloud
/scrape, /crawlYesYes
/agent, /browserNoYes
ScreenshotsYes (Playwright)Yes
Fire-engine (IP blocks, anti-bot)NoYes
Local LLMs (Ollama)Yes (experimental)No
MaintenanceYouFirecrawl

Self-hosting fits teams that need data locality or custom Playwright config. For anti-bot targets and zero ops, use Firecrawl Cloud.

Resource Requirements

ComponentCPURAM
API + worker4 cores8 GB
Playwright service2 cores4 GB
Redis, RabbitMQ, Postgres1 core1–2 GB
Total4+ cores12+ GB

Scale down for light use; the docker-compose defaults may work on 8 GB but can be tight.

Troubleshooting

Containers exit immediately — Check docker compose logs api playwright-service. Ensure Redis and RabbitMQ are up before the API.

Supabase warnings — Normal for self-hosted. Scraping works. Supabase is for auth and advanced logging.

Playwright timeout — Increase mem_limit for playwright-service. Ensure the service is reachable at http://playwright-service:3000/scrape.

Apify Affiliate Banner 728x90Apify Affiliate Banner 728x90Apify Affiliate Banner 300x50Apify Affiliate Banner 300x50
Next step

Try the scrape endpoint locally. For production, deploy on a 16 GB VPS. For zero ops, use Firecrawl Cloud.

Frequently Asked Questions

Yes. Clone the repo, set .env, run docker compose up. Requires Docker, 8GB+ RAM. Cloud has /agent and Fire-engine.

Docker, 8 GB RAM minimum (12 GB recommended). API + Playwright + Redis + RabbitMQ + Postgres.

git pull in the repo, docker compose build, docker compose up -d. Check release notes for schema or env changes.

Common mistakes and fixes

Docker containers fail to start

Ensure 8GB+ RAM. Check docker logs. Verify .env has PORT, HOST. Redis and RabbitMQ must be healthy before API starts.

Supabase client not configured warning

Expected in self-hosted. Scraping works without it. Set USE_DB_AUTHENTICATION=false.

Playwright service timeout

Playwright service needs 2–4 GB RAM. Increase mem_limit in docker-compose. Ensure playwright-service starts before API.