Anubis vs Cloudflare Turnstile: Best for Open Source
In this article
For open-source sites, Cloudflare Turnstile is the better anti-bot protection because it is free, privacy-focused, and does not require a CAPTCHA challenge for most users. Anubis is a self-hosted proof-of-work system that is also free and open-source, but it is more technical to deploy and can block legitimate users with older devices. This article compares both options in depth so you can decide which fits your project.
Background: Why Open-Source Sites Need Anti-Bot Protection
Open-source projects often run community forums, wikis, issue trackers, and download mirrors. These are prime targets for spam, scraping, and credential-stuffing attacks because the infrastructure is publicly documented and often self-hosted. Traditional CAPTCHAs like reCAPTCHA are disliked for tracking users and showing annoying image puzzles. Both Anubis and Turnstile were created to solve this without forcing users to solve puzzles, but they take very different approaches.
How Anubis Works
Anubis is a self-hosted reverse proxy that challenges clients with a proof-of-work puzzle before allowing access. When a request arrives, Anubis sends a JavaScript challenge that requires the client to compute a hash (SHA-256) with a difficulty target. The client’s browser solves it in a few seconds, then gets a cookie to bypass future challenges. This is similar to how cryptocurrency mining works, but much lighter.
- Deployment: You run Anubis as a Docker container or binary in front of your web server.
- Configuration: You set the difficulty level, cookie duration, and which paths to protect.
- User experience: Most modern browsers solve the puzzle in under 3 seconds, but older mobile devices can take 10+ seconds.
Because it is open-source (MIT license), you can audit the code and modify it. It does not rely on any third-party service—all data stays on your server.
How Cloudflare Turnstile Works
Turnstile is a hosted widget that uses a series of non-interactive browser challenges to verify a user is human. It analyzes browser signals (like TLS fingerprint, mouse movements, and browser history) to assign a score. If the score is high, the user sees nothing; if it is low, they may get a checkbox or an image puzzle. Turnstile is free for unlimited use, even for non-Cloudflare customers.
- Deployment: Add a JavaScript snippet to your HTML and validate the token on your server.
- Configuration: You can set a site key and secret key, choose a widget mode (managed, non-interactive, or invisible), and adjust the security level.
- User experience: Most users see nothing at all; those with suspicious browsers get a challenge.
Turnstile is closed-source, but Cloudflare publishes a technical report on how it works. It does not track users across sites for advertising, and it is designed to be privacy-compliant with GDPR.
Comparing Security and User Experience
Both tools are effective against basic bots, but they differ in edge cases.
- Anubis blocks any client that does not execute JavaScript, which includes some screen readers and text browsers. It also blocks curl and wget unless you whitelist them. This is great for stopping scrapers, but it can annoy power users who use command-line tools.
- Turnstile allows non-JavaScript clients if you set the fallback action to “allow,” but that might let bots through. It also has a visual fallback for very old browsers, which Anubis lacks.
- Accessibility: Turnstile is generally better for users with disabilities because it offers an audio challenge and a simpler checkbox. Anubis has no such option.
- Performance: Anubis adds a few seconds of delay on every new session. Turnstile adds almost zero delay for most users.
In practice, Anubis is stricter and more transparent, while Turnstile is smoother and more accessible.
Costs and Maintenance
Both are free, but their operational costs differ.
- Anubis: You must maintain the server, update the Docker image, and monitor logs. It consumes CPU for each challenge, but it is negligible for small sites. There is no external dependency.
- Turnstile: You rely on Cloudflare’s infrastructure. If Cloudflare has an outage, your forms may fail. You also need to keep your secret key secure and rotate it if exposed.
For a small open-source project with limited time, Turnstile is easier to integrate—just copy-paste a script. Anubis requires more setup but gives you full control.
Common Problems and Misconceptions
A common misconception is that Anubis is a CAPTCHA. It is not—it is a proof-of-work system. Another is that Turnstile tracks users for advertising; it does not, and Cloudflare explicitly states it does not use the data for ad targeting.
Real problems you might face:
- Anubis: Some ad-blockers or privacy extensions might block the challenge script, causing a loop. You can whitelist your own domain, but that adds friction.
- Turnstile: If your site is behind a VPN or Tor, users may get a challenge every time. You can adjust the security level, but that might let more bots through.
- Both: If you use a CDN like Cloudflare, you might double-protect your site, which can break forms. You need to configure carefully.
Another misconception is that proof-of-work is “green” because it does not require massive mining farms. While it is far less energy-intensive than Bitcoin, it still uses CPU cycles. Turnstile uses almost no energy on the client side.
How to Choose for Your Open-Source Site
Consider your audience and your technical skills.
- If your users are developers who use curl or wget, Anubis will frustrate them. Turnstile is better.
- If you want to avoid any third-party dependency and have time to maintain a proxy, Anubis is a solid choice.
- If you need accessibility compliance, Turnstile is the safer bet.
- If you are behind Cloudflare already, Turnstile integrates seamlessly with your existing setup.
For most open-source sites, Turnstile is the pragmatic choice because it is free, easy to implement, and provides a good user experience. Anubis is a niche tool for those who prioritize self-hosting and transparency over convenience.
Alternatives to Consider
There are other options like hCaptcha (free but shows ads), Friendly Captcha (proof-of-work, but paid), and simple honeypot fields (not robust). For open-source projects, you could also use a combination: Turnstile for public forms and a rate limiter for API endpoints.
Frequently Asked Questions
Is Anubis really free?
Yes, Anubis is completely free and open-source under the MIT license. You only pay for the server resources you run it on.
Does Cloudflare Turnstile work without a Cloudflare account?
Yes, you can use Turnstile on any site by creating a free Cloudflare account to get site keys. You do not need to move your DNS to Cloudflare.
Can Anubis block all bots?
No, sophisticated bots can solve proof-of-work challenges if they emulate a browser. It stops casual scrapers but not determined attackers.
Does Turnstile slow down my site?
No, the widget loads asynchronously and adds negligible overhead. The main delay is when a user gets a challenge, which is rare for normal visitors.
Which is better for privacy?
Anubis is better because it processes everything on your server and shares no data with third parties. Turnstile sends browser signals to Cloudflare, but they claim not to use it for advertising.
Can I use both together?
Yes, you could put Anubis in front of your server and Turnstile on your forms, but that is overkill for most sites and may cause conflicts. It is usually better to pick one.