Skip to content

Latest commit

 

History

History
137 lines (106 loc) · 2.73 KB

File metadata and controls

137 lines (106 loc) · 2.73 KB

Open Browser Rendering - Quick Start Guide

Get started with Open Browser Rendering in 5 minutes!

Option 1: Docker (Recommended)

Prerequisites

  • Docker installed
  • Docker Compose installed

Steps

  1. Clone the repository
git clone https://github.com/devmode-id/OpenBrowserRendering.git
cd OpenBrowserRendering
  1. Configure environment
cp .env.example .env
# Edit .env and set your API key
  1. Start the service
docker-compose up -d
  1. Test it
# Health check
curl http://localhost:3000/health

# Take a screenshot
curl -X POST http://localhost:3000/screenshot \
  -H "Authorization: Bearer supersecret123" \
  -H "Content-Type: application/json" \
  -o screenshot.png \
  -d '{"url": "https://example.com"}'

Done! Your service is running on http://localhost:3000

Option 2: Node.js

Prerequisites

  • Node.js >= 18.0.0
  • npm

Steps

  1. Clone the repository
git clone https://github.com/devmode-id/OpenBrowserRendering.git
cd OpenBrowserRendering
  1. Install dependencies
npm install
  1. Install Playwright browsers
npx playwright install --with-deps
  1. Configure environment
cp .env.example .env
# Edit .env and set your API key
  1. Start the service
npm start
  1. Test it
# Health check
curl http://localhost:3000/health

# Take a screenshot
curl -X POST http://localhost:3000/screenshot \
  -H "Authorization: Bearer supersecret123" \
  -H "Content-Type: application/json" \
  -o screenshot.png \
  -d '{"url": "https://example.com"}'

Done! Your service is running on http://localhost:3000

Next Steps

Common Issues

Port already in use

Change the port in .env:

PORT=3001

Permission denied (Docker)

Add your user to docker group:

sudo usermod -aG docker $USER

Browser installation fails

Install system dependencies:

# Ubuntu/Debian
sudo apt-get install -y \
  libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 \
  libcups2 libdrm2 libxkbcommon0 libxcomposite1 \
  libxdamage1 libxfixes3 libxrandr2 libgbm1 \
  libasound2

Need Help?


Made with ❤️ by DEVMODE Community