Open Source Alternatives to Clerk

Updated 5 December 2026 · 3 alternatives · Backend, Hosting & Auth

Clerk is a hosted authentication service with drop-in UI components, priced by monthly active users. Here are 3 open source alternatives, 2 of them self-hostable.
Top pickBetter AuthMIT · ★ 31k
Best self-hostedHankoAGPL-3.0 · ★ 9.1k
Hosted optionHankoAGPL-3.0 · ★ 9.1k
Clerk is made byClerk Inc.Proprietary

Clerk alternatives compared

Project Licence Type Self-host Cloud option GitHub stars
Better Auth MIT Developer tool — — ★ 31k
Hanko AGPL-3.0 Self-hosted ✓ Yes ✓ Yes ★ 9.1k
Ory Kratos Apache-2.0 Self-hosted ✓ Yes ✓ Yes ★ 14k

The 3 open source alternatives to Clerk

1

Better Auth

MIT · Developer tool · ★ 31k on GitHub · since 2024

Visit site ↗

Better Auth is a TypeScript library that adds email, social, passkey and two-factor login to your app, storing users in your own database. Plugins add organisations, SSO and more.

  • Email, social and passkey login
  • Organisations and roles
  • Two-factor authentication
  • Works with any TS framework
Source code ↗ Also replaces Auth0
2

Hanko

AGPL-3.0 · Self-hosted · ★ 9.1k on GitHub · since 2022

Visit site ↗

Hanko is an authentication server with drop-in web components for login and profile pages. It focuses on passkeys and also supports passwords, passcodes and social logins.

Note: The backend is AGPL-3.0; the frontend elements and SDKs are MIT.

  • Passkeys first
  • Drop-in web components
  • Social and SAML login
  • Hosted or self-hosted
Self-hosted Cloud option Source code ↗ Also replaces Auth0
3

Ory Kratos

Apache-2.0 · Self-hosted · ★ 14k on GitHub · since 2019

Visit site ↗

Ory Kratos is an API-first identity server for registration, login, MFA and account recovery. It is headless, so you build your own UI, and it scales to very large user bases.

  • Headless API
  • MFA and passkeys
  • Social sign-in
  • Part of the Ory stack (Hydra, Keto)
Self-hosted Cloud option Source code ↗ Also replaces Auth0, Okta

How to choose an open source alternative to Clerk

Check passkeys, social login, organisations and multi-tenancy, plus ready-made UI components for your framework.

If you want your data on your own server, look at Hanko and Ory Kratos. Don't want to run a server? Hanko and Ory Kratosoffer an official hosted version.

Not sure where to start? Browse all backend, hosting & auth projects.

Clerk alternatives: FAQ

What is the best open source alternative to Clerk?

Better Auth is the most complete open source alternative to Clerk on our list, followed by Hanko and Ory Kratos. The best choice depends on what you need: Check passkeys, social login, organisations and multi-tenancy, plus ready-made UI components for your framework.

Is there a free alternative to Clerk?

Yes. Every alternative listed here is open source, so the software itself is free to use. Some, such as Hanko and Ory Kratos, also sell an optional hosted version if you don't want to run it yourself.

Can I self-host an alternative to Clerk?

Yes: Hanko and Ory Kratos can all be installed on your own server, so your data stays on infrastructure you control.

Why switch from Clerk to open source software?

Clerk is proprietary software owned by Clerk Inc.: you can't see the code, and pricing, features and terms can change at any time. Open source alternatives publish their code under licences such as MIT, AGPL-3.0 and Apache-2.0, can be audited by anyone, and can't lock you in, because the software can always be forked or self-hosted.

Other popular alternatives

Browse 350+ open source alternativesSearch by product, category or licence