Clerk vs Keycloak

Clerk: Shipping polished auth fast without running it yourself.; Keycloak: Organisations that need self-hosted SSO and identity management.

FieldClerkKeycloak
PricingFree tierOpen source
Open sourceNoYes
Self-hostableNoYes
EcosystemJavaScript / TypeScriptLanguage-agnostic
CategoryAuthAuth

Choose Clerk over Keycloak when

Choose it for a hosted service instead of running identity servers. The free Hobby plan covers 50,000 retained users per app; Pro is $25 a month plus $0.02 per retained user from 50,001 to 100,000, or $1,025 a month at 100,000.

Clerk: a hosted service. It bills monthly retained users, meaning users who come back at least one day after signing up. The free Hobby plan covers 50,000 per app; Pro costs $25 a month plus $0.02 per retained user from 50,001 to 100,000, which works out to $1,025 a month at 100,000. Pro includes one enterprise SSO connection, then $75 a month each (pricing).

SourceChecked 25 November 2026

Clerk

Hosted authentication and user management with prebuilt sign-in components, organisations and session handling.

Choose Clerk if

Shipping polished auth fast without running it yourself.

Why it’s here

Clerk is a hosted auth service: prebuilt sign-in, profile and organization components, a user database and session handling you do not run. In Next.js, npx -y clerk@latest init writes the provider, middleware and auth routes (quickstart). Each session token is a JWT that expires after 60 seconds and is refreshed in the background, which limits what a stolen token is worth (how Clerk works).

Pricing

From the official pricing page, read 2026-11-17, in US dollars (pricing):

  • Hobby (free): 50,000 monthly retained users (MRUs) per app, up to 3 social connections, sessions fixed at 7 days, no MFA, no passkeys, 1 day of logs.
  • Pro: $25 a month, or $20 billed annually. 50,000 MRUs included, then $0.02 each up to 100,000 and $0.018 each up to 1,000,000. So 100,000 MRUs on monthly billing costs $25 + 50,000 x $0.02 = $1,025. Includes MFA, passkeys, custom session length and 1 enterprise SSO connection; each extra connection is $75 a month.
  • Business: $300 a month ($250 annually). Adds 10 dashboard seats, the SOC 2 report and priority support with no response-time SLA. The 99.99% uptime SLA is Enterprise only.
  • Add-ons: B2B Authentication Enhanced at $100 a month ($85 annually) lifts the 20-member cap per organization and adds verified domains and custom roles. SMS codes cost $0.01 each in the US and Canada.

A user counts only if they return at least 24 hours after signing up, so a sign-up that never comes back is never billed.

Pick it when

  • You want sign-in, profile and organization screens without building them, with SDKs for React, Next.js, Expo, Astro and native Android (docs index).
  • You sell to businesses and need SAML or OIDC SSO soon: one connection is in the Pro price.
  • Retention tracks revenue. Clerk's own FAQ says it is easiest to justify when it does (FAQ).

Skip it when

  • You need auth to run on your own servers. Clerk sells only hosted plans.
  • Your app is free, ad-supported or low revenue per user. Clerk's FAQ warns that per-MRU pricing "may feel expensive once you outgrow the free tier".

Current state

@clerk/nextjs 7.10.2 was published 2026-11-17, after 7.10.0 on 2026-11-14 and 7.9.26 on 2026-11-12 (releases). The clerk/javascript repository is MIT, copyright Clerk Inc (LICENSE); it holds the SDKs, not the hosted service.

Setup

npx -y clerk@latest init

Watch out for

You cannot migrate users from a development instance to production (migrating). Leaving is possible: the dashboard exports a CSV that includes hashed passwords, but moving to another provider ends every active session. Production Backend API calls are limited to 1,000 requests per 10 seconds per instance, and the currentUser() helper counts against that limit (rate limits). Directory Sync billing starts on 2027-01-01 (pricing).

Keycloak

An open-source identity and access management server with single sign-on, OpenID Connect, SAML and user federation.

Choose Keycloak if

Organisations that need self-hosted SSO and identity management.

Why it’s here

Keycloak is an identity provider you run yourself. It speaks OpenID Connect, OAuth 2.0 and SAML 2.0, federates users from existing LDAP or Active Directory servers, and brokers sign-in to other OIDC or SAML identity providers (keycloak.org). Passkeys have been supported since 26.4, and Organizations, for multi-tenant B2B apps, since 26.0 (release notes).

Pick it when

  • Identity data has to stay on your own infrastructure, or users already live in LDAP or Active Directory.
  • Many applications need single sign-on over a mix of OIDC and SAML.
  • Your user count is large enough that per-user pricing dominates: Keycloak is Apache-2.0 with no licence fee, so cost is servers and staff time.

Skip it when

  • One app needs email, password and social sign-in. A hosted service such as Clerk, or a library inside your app such as Better Auth, avoids running a separate Java service and its database.
  • Nobody on the team can own a quarterly upgrade. See Watch out for.

Against the alternatives

  • Self-hosted peers carry different licences: Zitadel is AGPL-3.0 with some directories excepted (README), Authentik is MIT outside its enterprise directory (LICENSE), and Ory Kratos is Apache-2.0 (repo).

Sizing. The official guide budgets 1 vCPU per 15 password logins per second, 1 vCPU per 120 client-credential grants or refresh-token requests per second, 1,250 MB of memory per pod, and 150% CPU headroom for spikes. Its worked example of 45 logins, 360 grants and 360 refreshes per second comes to 9 vCPU across 3 pods (sizing guide).

Setup

A dev-mode server with an admin account on port 8080 (getting started):

docker run -p 127.0.0.1:8080:8080 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:26.8.2 start-dev

Production needs a real database, such as PostgreSQL 14 to 18, because the default dev-file database is not for production (databases). The zip distribution needs OpenJDK 25 (zip guide); the container image runs OpenJDK 21 to support FIPS mode.

Current state

The latest release is 26.8.2, published 2026-11-05 (GitHub). Keycloak has been a CNCF incubating project since April 2023 (CNCF), and 8 of its 11 maintainers, including the project lead, list IBM as their affiliation (MAINTAINERS.md). Red Hat sells a supported build, whose current documentation covers 26.6 (Red Hat build of Keycloak).

Watch out for

Only the latest minor release gets fixes, minors ship about four times a year, and the previous minor loses support as soon as a new one ships; important bug and security fixes "might introduce non-opt-in breaking changes in any release" (RELEASES.md). Plan to test and roll out an upgrade every quarter. Login pages are Apache FreeMarker templates, so a custom login form means copying .ftl files into your own theme and carrying them through those upgrades (themes).

Keycloak on GitHub