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
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
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
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)
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.