Self-hosting
Learn how to self-host Firecrawl to run on your own and contribute to the project.
Contributor?
Welcome to Firecrawl 🔥! Here are some instructions on how to get the project locally so you can run it on your own and contribute.
If you’re contributing, note that the process is similar to other open-source repos, i.e., fork Firecrawl, make changes, run tests, PR.
If you have any questions or would like help getting on board, join our Discord community here for more information or submit an issue on Github here!
Self-hosting Firecrawl
Refer to SELF_HOST.md for instructions on how to run it locally.
Why?
Self-hosting Firecrawl is particularly beneficial for organizations with stringent security policies that require data to remain within controlled environments. Here are some key reasons to consider self-hosting:
- Enhanced Security and Compliance: By self-hosting, you ensure that all data handling and processing complies with internal and external regulations, keeping sensitive information within your secure infrastructure. Note that Firecrawl is a Mendable product and relies on SOC2 Type2 certification, which means that the platform adheres to high industry standards for managing data security.
- Customizable Services: Self-hosting allows you to tailor the services, such as the Playwright service, to meet specific needs or handle particular use cases that may not be supported by the standard cloud offering.
- Learning and Community Contribution: By setting up and maintaining your own instance, you gain a deeper understanding of how Firecrawl works, which can also lead to more meaningful contributions to the project.
Considerations
However, there are some limitations and additional responsibilities to be aware of:
- Limited Access to Fire-engine: Currently, self-hosted instances of Firecrawl do not have access to Fire-engine, which includes advanced features for handling IP blocks, robot detection mechanisms, and more. This means that while you can manage basic scraping tasks, more complex scenarios might require additional configuration or might not be supported.
- Manual Configuration Required: If you need to use scraping methods beyond the basic fetch and Playwright options, you will need to manually configure these in the
.env
file. This requires a deeper understanding of the technologies and might involve more setup time.
Self-hosting Firecrawl is ideal for those who need full control over their scraping and data processing environments but comes with the trade-off of additional maintenance and configuration efforts.
Steps
- First, start by installing the dependencies
- Docker instructions
- Set environment variables
Create an .env
in the root directory you can copy over the template in apps/api/.env.example
To start, we wont set up authentication, or any optional sub services (pdf parsing, JS blocking support, AI features)
-
(Optional) Running with TypeScript Playwright Service
-
Update the
docker-compose.yml
file to change the Playwright service:TO
-
Set the
PLAYWRIGHT_MICROSERVICE_URL
in your.env
file: -
Don’t forget to set the proxy server in your
.env
file as needed.
-
-
Build and run the Docker containers:
This will run a local instance of Firecrawl which can be accessed at http://localhost:3002
.
You should be able to see the Bull Queue Manager UI on http://localhost:3002/admin/@/queues
.
- (Optional) Test the API
If you’d like to test the crawl endpoint, you can run this:
Troubleshooting
This section provides solutions to common issues you might encounter while setting up or running your self-hosted instance of Firecrawl.
Supabase client is not configured
Symptom:
Explanation: This error occurs because the Supabase client setup is not completed. You should be able to scrape and crawl with no problems. Right now it’s not possible to configure Supabase in self-hosted instances.
You’re bypassing authentication
Symptom:
Explanation: This error occurs because the Supabase client setup is not completed. You should be able to scrape and crawl with no problems. Right now it’s not possible to configure Supabase in self-hosted instances.
Docker containers fail to start
Symptom: Docker containers exit unexpectedly or fail to start.
Solution: Check the Docker logs for any error messages using the command:
- Ensure all required environment variables are set correctly in the .env file.
- Verify that all Docker services defined in docker-compose.yml are correctly configured and the necessary images are available.
Connection issues with Redis
Symptom: Errors related to connecting to Redis, such as timeouts or “Connection refused”.
Solution:
- Ensure that the Redis service is up and running in your Docker environment.
- Verify that the REDIS_URL and REDIS_RATE_LIMIT_URL in your .env file point to the correct Redis instance.
- Check network settings and firewall rules that may block the connection to the Redis port.
API endpoint does not respond
Symptom: API requests to the Firecrawl instance timeout or return no response.
Solution:
- Ensure that the Firecrawl service is running by checking the Docker container status.
- Verify that the PORT and HOST settings in your .env file are correct and that no other service is using the same port.
- Check the network configuration to ensure that the host is accessible from the client making the API request.
By addressing these common issues, you can ensure a smoother setup and operation of your self-hosted Firecrawl instance.
Install Firecrawl on a Kubernetes Cluster (Simple Version)
Read the examples/kubernetes-cluster-install/README.md for instructions on how to install Firecrawl on a Kubernetes Cluster.