Docker Web Scraping on Liquid Web: Containerize Your Scrapers
Running web scrapers in Docker on a Liquid Web VPS gives you reproducible builds, easier deploys, and isolation from the host. This guide covers VPS choice, Docker install, a Playwright-based Dockerfile, and a docker-compose stack for scraper + Redis + cron.
Prerequisites
- Liquid Web VPS with Ubuntu 22.04 or 24.04 (or similar Linux)
- SSH access and sudo
- At least 4 GB RAM for Playwright (2 GB for simple HTTP scrapers)
See Liquid Web VPS scraping setup for provisioning.
Step 1: Choose the Right VPS Plan
| Plan | vCPU | RAM | Storage | Price | Use case |
|---|---|---|---|---|---|
| 4 GB | 2 | 4 GB | 80 GB | $8.50/mo* | Single Playwright scraper |
| 8 GB | 4 | 8 GB | 240 GB | $22.50/mo* | Multiple scrapers or Crawlee |
| 16 GB | 6 | 16 GB | 440 GB | $45/mo* | High-concurrency, Firecrawl |
*Promotional pricing; check Liquid Web for current offers.
Step 2: Install Docker
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update && sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
Add your user to the docker group:
sudo usermod -aG docker $USER
# Log out and back in, or: newgrp docker
Verify:
docker --version
docker compose version
Step 3: Scraper Dockerfile (Playwright + Node)
Example for a Node.js Playwright scraper:
# Use official Playwright image for Chromium
FROM mcr.microsoft.com/playwright:v1.40.0-jammy
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
CMD ["node", "scraper.js"]
Or Python + Playwright:
FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN playwright install chromium
COPY . .
CMD ["python", "scraper.py"]
For simple HTTP scraping (no browser), a slim Node image is enough:
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
CMD ["node", "scraper.js"]
Step 4: Docker Compose Stack
docker-compose.yml for a scraper with optional Redis:
services:
scraper:
build: .
mem_limit: 2g
restart: "no"
environment:
- REDIS_URL=redis://redis:6379
depends_on:
- redis
redis:
image: redis:alpine
restart: unless-stopped
For scheduled runs, use cron:
# Run scraper every hour
0 * * * * cd /home/user/scraper && docker compose run --rm scraper
Step 5: Build and Run
docker compose build
docker compose run --rm scraper
Or run Redis detached:
docker compose up -d redis
docker compose run --rm scraper
Playwright in Docker: Common Pitfalls
- Sandbox — Chromium needs
--no-sandboxin containers. Playwright images do this by default. - Memory — Allocate at least 2 GB to the scraper service.
- Display — No X11 needed; Playwright uses headless mode.
Alternative: Cloud Scraping
If you prefer not to manage containers:
- Apify — Managed actors, scheduling, proxies
- Firecrawl — Crawl API, or self-host with Docker
Start with the 4 GB Liquid Web plan, install Docker, and run a single scraper container.
Yes for production: reproducible builds, easier deploys, isolation. Overkill for one-off scripts.
Use mcr.microsoft.com/playwright as base. Copy code, install deps, run entrypoint. Allocate at least 2GB RAM.
Playwright: mcr.microsoft.com/playwright. Simple HTTP: node:20-slim or python:3.11-slim.




