Open Browser Rendering is a self-hosted, open-source alternative to Cloudflare Browser Rendering API. It allows you to capture screenshots, generate PDFs, and execute JavaScript in a headless browser environment via a simple REST API.
- Self-hosted: You control your infrastructure and data
- Open-source: Free to use, modify, and contribute
- No vendor lock-in: Deploy anywhere you want
- Customizable: Modify the code to fit your needs
- Cost-effective: No per-request pricing
- Chromium (default, recommended)
- Firefox
- WebKit
You can switch between browsers using the BROWSER_ENGINE environment variable.
- Node.js: >= 18.0.0
- RAM: Minimum 2GB (4GB+ recommended for production)
- CPU: 2+ cores recommended
- Disk: 2GB+ for browser binaries and dependencies
Yes! The service runs on Windows, macOS, and Linux. However, Docker deployment is recommended for production use.
No, Docker is optional. You can run the service directly with Node.js. However, Docker is recommended for:
- Easier deployment
- Consistent environment
- Better resource management
- Simplified updates
If running without Docker:
npx playwright install --with-depsDocker images already include browsers.
Edit the .env file:
RENDERER_API_KEY=your-secure-key-here
Or set environment variable:
export RENDERER_API_KEY=your-secure-key-hereBased on available RAM:
- 2GB RAM:
MAX_CONCURRENCY=2 - 4GB RAM:
MAX_CONCURRENCY=4 - 8GB RAM:
MAX_CONCURRENCY=8 - 16GB+ RAM:
MAX_CONCURRENCY=16
Edit .env:
ALLOWED_ORIGINS=https://example.com,https://app.example.com
No, you can only use one browser engine at a time. Set BROWSER_ENGINE to your preferred engine.
Set fullPage: true in screenshotOptions:
{
"url": "https://example.com",
"screenshotOptions": {
"fullPage": true
}
}Not directly. The API doesn't support cookies or authentication headers. You would need to:
- Modify the code to accept cookies
- Use the
/evaluateendpoint to handle login - Use a session management solution
- PNG (default, lossless)
- JPEG (with quality control)
- Letter
- Legal
- Tabloid
- Ledger
- A0, A1, A2, A3, A4, A5, A6
Default timeout is 30 seconds. You can adjust this with gotoOptions.timeout (in milliseconds):
{
"url": "https://example.com",
"gotoOptions": {
"timeout": 60000
}
}It determines when the page is considered loaded:
load: Wait for the load eventdomcontentloaded: Wait for DOMContentLoaded eventnetworkidle: Wait for network to be idle (recommended for dynamic content)
Probably not. Shared hosting typically doesn't support:
- Node.js long-running processes
- Browser automation
- Sufficient resources
Use a VPS or cloud server instead.
- DigitalOcean (Droplet)
- Linode
- Vultr
- AWS EC2
- Google Cloud Compute Engine
- Azure Virtual Machines
Minimum: 2GB RAM, 2 vCPU
Use Nginx as a reverse proxy with Let's Encrypt:
sudo apt install nginx certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.comSee deployment guide in README for details.
Yes! You can deploy using Kubernetes. Create a deployment and service:
- Use the Docker image
- Set environment variables via ConfigMap/Secret
- Configure resource limits
- Set up horizontal pod autoscaling
Docker:
cd /path/to/OpenBrowserRendering
git pull
docker-compose down
docker-compose up -d --buildPM2:
cd /path/to/OpenBrowserRendering
git pull
npm install
pm2 restart open-browser-renderingDepends on:
- Server resources (CPU, RAM)
- Page complexity
- Screenshot/PDF size
- Concurrency settings
Typical performance:
- 2GB RAM: 2-4 concurrent requests
- 4GB RAM: 4-8 concurrent requests
- 8GB RAM: 8-16 concurrent requests
- Increase
MAX_CONCURRENCY(if you have resources) - Use smaller viewport sizes
- Disable
fullPagewhen not needed - Use JPEG instead of PNG (smaller file size)
- Reduce timeout values
- Add more RAM/CPU
- Use a queue system for high traffic
Common reasons:
- Page has heavy JavaScript
- Large images/resources
- Network latency
- Insufficient server resources
- Too many concurrent requests
Try:
- Increase timeout
- Use
waitUntil: "load"instead of "networkidle" - Optimize the target page
- Upgrade server resources
You've hit the MAX_CONCURRENCY limit. Either:
- Wait and retry
- Increase
MAX_CONCURRENCY(if you have resources) - Implement a queue system
The page took too long to load. Try:
- Increase
gotoOptions.timeout - Check if the URL is accessible
- Try a different
waitUntiloption - Check network connectivity
Usually due to insufficient resources:
- Increase server RAM
- Reduce
MAX_CONCURRENCY - Restart the service
- Check for memory leaks
Check logs:
docker-compose logs -fCommon issues:
- Insufficient memory
- Port already in use
- Invalid configuration
- Missing environment variables
Possible causes:
- Page requires JavaScript (use
waitUntil: "networkidle") - Page blocks headless browsers
- Authentication required
- Page has errors
Only if you:
- Use a strong API key
- Enable HTTPS
- Implement rate limiting
- Restrict CORS
- Monitor for abuse
- Keep software updated
Yes, if you don't need it. The /evaluate endpoint executes arbitrary JavaScript and should only be accessible to trusted users.
To disable, remove the endpoint from server.js.
- Use strong API key
- Implement rate limiting (Nginx, Cloudflare)
- Monitor usage
- Set up alerts
- Use IP whitelisting
- Implement request validation
- Set resource limits
See CONTRIBUTING.md for guidelines.
- Check if it's already reported in Issues
- Create a new issue with details
- Include reproduction steps
- Provide environment information
Create a feature request issue with:
- Problem description
- Proposed solution It determines when the page is considered loaded:
load: Wait for the load eventdomcontentloaded: Wait for DOMContentLoaded eventnetworkidle: Wait for network to be idle (recommended for dynamic content)
Probably not. Shared hosting typically doesn't support:
- Node.js long-running processes
- Browser automation
- Sufficient resources
Use a VPS or cloud server instead.
- DigitalOcean (Droplet)
- Linode
- Vultr
- AWS EC2
- Google Cloud Compute Engine
- Azure Virtual Machines
Minimum: 2GB RAM, 2 vCPU
Use Nginx as a reverse proxy with Let's Encrypt:
sudo apt install nginx certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.comSee deployment guide in README for details.
Yes! You can deploy using Kubernetes. Create a deployment and service:
- Use the Docker image
- Set environment variables via ConfigMap/Secret
- Configure resource limits
- Set up horizontal pod autoscaling
Docker:
cd /path/to/OpenBrowserRendering
git pull
docker-compose down
docker-compose up -d --buildPM2:
cd /path/to/OpenBrowserRendering
git pull
npm install
pm2 restart open-browser-renderingDepends on:
- Server resources (CPU, RAM)
- Page complexity
- Screenshot/PDF size
- Concurrency settings
Typical performance:
- 2GB RAM: 2-4 concurrent requests
- 4GB RAM: 4-8 concurrent requests
- 8GB RAM: 8-16 concurrent requests
- Increase
MAX_CONCURRENCY(if you have resources) - Use smaller viewport sizes
- Disable
fullPagewhen not needed - Use JPEG instead of PNG (smaller file size)
- Reduce timeout values
- Add more RAM/CPU
- Use a queue system for high traffic
Common reasons:
- Page has heavy JavaScript
- Large images/resources
- Network latency
- Insufficient server resources
- Too many concurrent requests
Try:
- Increase timeout
- Use
waitUntil: "load"instead of "networkidle" - Optimize the target page
- Upgrade server resources
You've hit the MAX_CONCURRENCY limit. Either:
- Wait and retry
- Increase
MAX_CONCURRENCY(if you have resources) - Implement a queue system
The page took too long to load. Try:
- Increase
gotoOptions.timeout - Check if the URL is accessible
- Try a different
waitUntiloption - Check network connectivity
Usually due to insufficient resources:
- Increase server RAM
- Reduce
MAX_CONCURRENCY - Restart the service
- Check for memory leaks
Check logs:
docker-compose logs -fCommon issues:
- Insufficient memory
- Port already in use
- Invalid configuration
- Missing environment variables
Possible causes:
- Page requires JavaScript (use
waitUntil: "networkidle") - Page blocks headless browsers
- Authentication required
- Page has errors
Only if you:
- Use a strong API key
- Enable HTTPS
- Implement rate limiting
- Restrict CORS
- Monitor for abuse
- Keep software updated
Yes, if you don't need it. The /evaluate endpoint executes arbitrary JavaScript and should only be accessible to trusted users.
To disable, remove the endpoint from server.js.
- Use strong API key
- Implement rate limiting (Nginx, Cloudflare)
- Monitor usage
- Set up alerts
- Use IP whitelisting
- Implement request validation
- Set resource limits
See CONTRIBUTING.md for guidelines.
- Check if it's already reported in Issues
- Create a new issue with details
- Include reproduction steps
- Provide environment information
Create a feature request issue with:
- Problem description
- Proposed solution
- Use case
- Alternative solutions considered
This is a community project by DEVMODE Community. For commercial support, consider:
- Hiring a developer
- Contributing to the project
- Sponsoring development
Yes! You can hire a developer familiar with:
- Node.js
- Docker
- Linux server administration
- Nginx configuration
Made with ❤️ by DEVMODE Community