
Deploy Firecrawl | Self-Hosted Web Scraper API (Apify Alternative)
Self-hosted web scraper API: crawl sites to LLM-ready markdown. Key-locked
Redis
Just deployed
/data
Playwright
Just deployed
RabbitMQ
Just deployed
Postgres
Just deployed
/var/lib/postgresql/data
Firecrawl
Just deployed
Deploy and Host Firecrawl (Self-Hosted Web Scraper API, Apify Alternative) on Railway
Firecrawl is an open-source web scraper and crawler API that turns any website into clean markdown or structured data for LLMs and AI agents. Scrape a page, crawl a whole site or map its links through the same API and SDKs as Firecrawl's cloud. It is a self-hosted alternative to Apify and Scrapy, with no per-page credits.
About Hosting Firecrawl
This template runs Firecrawl's official API image with everything it needs: a Playwright browser service for pages that need JavaScript, Postgres for the job queue, Redis and RabbitMQ. Only the API has a public domain.
Self-hosted Firecrawl has no auth of its own, so anyone who finds the URL could use it. This template puts a small gate in front of the API that rejects every request without the generated FIRECRAWL_API_KEY.
After deploying:
- Copy
FIRECRAWL_API_KEYfrom the Firecrawl service's Variables tab. - Point any Firecrawl SDK at your domain, or send
Authorization: Bearerto/v2/scrape. - Watch jobs at
/admin//queues.
A GitHub Action checks for new Firecrawl production builds every day and smoke-tests each one before it reaches you. Railway then shows an update notice, and you apply it when it suits you.
Common Use Cases
- Turn websites and docs into markdown for RAG and LLM knowledge bases
- Give AI agents a scrape and crawl tool through Firecrawl's API or SDKs
- Crawl a whole site and keep its content in sync for search or analysis
- Extract structured JSON from pages with an LLM
- Replace paid scraping credits with your own server
Dependencies for Firecrawl Hosting
- Playwright with headless Chromium for JavaScript pages
- Postgres with
pg_cronfor the job queue - Redis for crawl state and rate limits
- RabbitMQ for extract jobs
- Optional: an OpenAI API key, or any OpenAI-compatible API, for JSON extraction, summaries and
/extract
Deployment Dependencies
- Firecrawl: https://github.com/firecrawl/firecrawl
- Firecrawl self-hosting guide: https://github.com/firecrawl/firecrawl/blob/main/SELF_HOST.md
- Firecrawl SDKs and API docs: https://docs.firecrawl.dev
- Template source: https://github.com/railhost/firecrawl-railway
Implementation Details
Firecrawl's API runs on localhost inside the container, and gate.mjs listens on the public port. Requests without the key get 401. / and /health/* stay open for Railway's healthcheck, and /admin/* is guarded by BULL_AUTH_KEY. If the key is missing or shorter than 16 characters, the service refuses to start rather than run an open API.
Self-hosted Firecrawl has no access to Fire-engine, Firecrawl's paid anti-bot service. Sites that block scrapers may fail, and page actions (click, scroll, wait) return an error. A proxy helps: set PROXY_SERVER, PROXY_USERNAME and PROXY_PASSWORD.
Why Deploy Firecrawl on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Firecrawl on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
Redis
redis:8.2Playwright
railhost/firecrawl-railwayRabbitMQ
rabbitmq:4.2Postgres
railhost/firecrawl-railwayFirecrawl
railhost/firecrawl-railway
