selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

capjs logo

Self-host capjs

capd@4.0.5

Privacy-first CAPTCHA using proof-of-work, no puzzles

ReleaseOpen SourceApache-2.0
Docker ComposeCompose file & guide
docker compose up -d
Updated23 minutes ago
LanguageJavaScript
Setup difficultyEasy
Stars
8 292
Port
3000 (HTTP server for the REST API, siteverify endpoint and admin dashboard)
Requires
Redis or Valkey
Docker
tiago2/cap
Cap admin dashboard for managing site keys

What is capjs?

Cap is a privacy-focused CAPTCHA you run on your own infrastructure, aimed at developers who want bot protection on forms and logins without sending visitor data to a third party. Instead of image puzzles, every challenge combines proof-of-work (parallel SHA-256 hashes, time-lock puzzles, or the GPU-resistant HashWX protocol) with server-generated JavaScript instrumentation that checks the real browser environment; instrumentation can also be tuned to block automated browsers driven by AI agents. The client is a roughly 20 kB web component with CSS-variable theming, i18n and RTL support, framework snippets for React, Vue, Svelte and others, plus an invisible programmatic mode. Verification goes through a small REST API whose /siteverify endpoint mimics reCAPTCHA's, so existing backend code can migrate by changing one URL. Self-hosting is a Docker Compose stack of the tiago2/cap container with Valkey/Redis; you log into a browser dashboard with an ADMIN_KEY and mint multiple site keys, with per-IP rate limiting and health endpoints included. One-click deploy on Railway and Workers-based setups are also offered. The project is Apache-2.0 licensed, used in production at companies such as bunny.net and AdGuard, and positions itself as compliant with GDPR and other privacy regimes.

capjs alternatives

All self-hosted alternatives to Cloudflare Turnstile → All self-hosted alternatives to Google reCAPTCHA → All self-hosted alternatives to hCaptcha →

Should you self-host capjs?

capjs scores 72/100 on selfhost.directory (how scoring works) and ranks #16 of 78 in Security. It has 8 292 GitHub stars, +357 in the last 30 days.

It shipped 32 stable releases in the past year. The latest, capd@4.0.5, came out on 9 November 2026.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is Apache-2.0-licensed and written mostly in JavaScript.

Its closest alternative on selfhost.directory is altcha (63/100, 2 888 stars). capjs scores higher overall. See capjs vs altcha side by side.

Features

  • Admin Dashboard
  • AI agent blocking
  • Browser instrumentation challenges
  • Customizable widget styling
  • Headless browser detection
  • Health check endpoints
  • Invisible / programmatic mode
  • Multiple site keys
  • Per-IP rate limiting
  • Proof-of-work challenges
  • reCAPTCHA-compatible siteverify API
  • REST API
  • RTL support

capjs README


cap logo

a privacy-first and self-hosted CAPTCHA.
read the docs or try the demo


cap widget

what's cap?

cap is a self-hosted and privacy-first captcha alternative that doesn't force your users to click on traffic lights. there are no puzzles, no tracking, and no third parties watching your visitors.

instead, the user's browser quietly solves a few small challenges in the background, such as gpu-resistant proof-of-work and instrumentation, which can also be configured to stop autonomous AI agents from using up your resources.

How to install capjs

Install capjs with Docker Compose

Environment variables
ADMIN_KEY, REDIS_URL

Create a docker-compose.yml file:

services:
  cap:
    image: tiago2/cap:latest
    container_name: cap
    ports:
      - "3000:3000"
    environment:
      ADMIN_KEY: your_secret_password
      REDIS_URL: redis://valkey:6379
    depends_on:
      valkey:
        condition: service_healthy
    restart: unless-stopped

  valkey:
    image: valkey/valkey:9-alpine
    container_name: cap-valkey
    volumes:
      - valkey-data:/data
    command: valkey-server --save 60 1 --loglevel warning --maxmemory-policy noeviction
    healthcheck:
      test: ["CMD", "valkey-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 5
    restart: unless-stopped

volumes:
  valkey-data:

Start the container:

docker compose up -d

Open the dashboard on port 3000 and log in with your admin key to create site keys.

How to configure capjs

  • ADMIN_KEYDashboard login password for Cap Standalone; recommended at least 32 characters.
  • REDIS_URLredis://localhost:6379Redis/Valkey connection string used for all data storage.
  • CORS_ORIGIN*Allowed origins for redeeming and generating challenges; comma-separated list.
  • ENABLE_ASSETS_SERVEREnable the built-in asset server that serves widget and WASM files from /assets.

    values: true

  • WIDGET_VERSIONlatestVersion of the @cap.js/widget package the asset server serves.

capjs releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

What is an open-source CAPTCHA?

Bot protection whose code you can read, audit and self-host instead of a closed third-party service; Cap is Apache 2.0 and runs on your own infrastructure.

What does it cost to self-host?

Cap Standalone reportedly fits on a $5 VPS for most sites, with no per-request fees, no third-party egress and no API quotas.

How effective is it against real bots?

The combination of instrumentation and proof-of-work is described as very effective at making automated abuse at scale difficult.

Can I migrate from reCAPTCHA / hCaptcha?

The siteverify API is compatible with reCAPTCHA and hCaptcha, but you need to swap the client-side code to use Cap's widget.

Is it GDPR-friendly?

Yes: Cap sets no cookies, doesn't phone home or fingerprint users, so only your own server sees the verification.

More in Security

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…