Docs
→Getting Started
→Installation
Installation
Complete installation guide for HeadlessX V2.0
Prerequisites
Before installing HeadlessX, ensure you have:
Quick Install
1. Clone the Repository
git clone https://github.com/yourusername/HeadlessX.git
cd HeadlessX
2. Install Dependencies
# Install all dependencies (pnpm required - npm/yarn will fail)
pnpm install
# Download Camoufox browser (runs automatically on install)
pnpm camoufox:fetch
Note: pnpm is required because the project uses workspace features. npm and yarn will not work correctly.
3. Configure Environment
Create .env files in the root and backend directories:
Root .env:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/headlessx"
# Backend API URL (for frontend)
NEXT_PUBLIC_API_URL="http://localhost:3001"
backend/.env:
# Server Configuration
PORT=3001
NODE_ENV=development
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/headlessx"
# Frontend URL (CORS)
FRONTEND_URL="http://localhost:3000"
# Logging
LOG_LEVEL=info
LOG_DIR=./logs
4. Setup Database
# Push schema to database
pnpm db:push
# Or run migrations
pnpm db:migrate
5. Start the System
# Start both frontend and backend
pnpm dev
Platform-Specific Scripts
Windows
# One-click install
scripts\install.bat
# Start development servers
scripts\start.bat
Linux / macOS
# One-click install
./scripts/install.sh
# Start development servers
./scripts/start.sh
Access Points
After installation, access the application at:
| Service | URL |
|---|---|
| 🖥️ Dashboard | http://localhost:3000 |
| 🔗 Backend API | http://localhost:3001 |
Verify Installation
Test the API
curl http://localhost:3001/health
Expected response:
{
"status": "ok",
"timestamp": "2026-01-28T12:00:00.000Z"
}
Test Scraping
curl -X POST http://localhost:3001/api/website/html \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{"url": "https://example.com"}'
Troubleshooting
Port Already in Use
If ports 3000 or 3001 are unavailable:
- Change
PORTinbackend/.env - Update
NEXT_PUBLIC_API_URLto match - Restart the servers
Camoufox Download Failed
# Manually download Camoufox
pnpm camoufox:fetch --force
# Or download from specific version
pnpm camoufox:fetch --version 0.1.0
Database Connection Error
- Verify PostgreSQL is running
- Check
DATABASE_URLformat:postgresql://username:password@host:port/database - Ensure database exists:
createdb headlessx
Dependencies Installation Issues
# Clear cache and reinstall
pnpm store prune
rm -rf node_modules
pnpm install
Production Deployment
Environment Variables
Set these in your production environment:
NODE_ENV=production
DATABASE_URL="your-production-db-url"
NEXT_PUBLIC_API_URL="https://api.yourdomain.com"
Build Commands
# Build frontend
cd frontend
pnpm build
# Build backend
cd backend
pnpm build
Start Production
# Frontend (runs on port 3000)
cd frontend
pnpm start
# Backend (runs on port 3001)
cd backend
pnpm start
Docker Installation (Coming Soon)
Docker support is planned for a future release. Track progress in Issue #XX.
Next Steps
- Getting Started - Learn basic usage
- API Reference - Explore API endpoints
- Configuration - Configure settings