Password-based authentication is one of the oldest security problems on the web. Despite decades of improvements — mandatory complexity rules, forced rotation, MFA — passwords remain the weakest link in most security architectures. Phishing, credential stuffing, and brute-force attacks exploit the fundamental flaw of shared secrets: the server must store something that can be stolen.
Passkeys, built on the FIDO2/WebAuthn standard, eliminate that problem entirely. Instead of a shared secret, authentication uses public-key cryptography. Your private key never leaves your device, and the server only stores a public key that is useless to attackers. Combined with built-in biometric verification (fingerprint, Face ID, Windows Hello), passkeys deliver stronger security with less friction.
In this guide, we will explore how to self-host passkey authentication, compare the best open-source solutions available in 2026, and walk through concrete deployment configurations.
Why Self-Host Your Passkey Authentication
You might wonder: if passkeys are so great, why not just use a cloud identity provider like Auth0, AWS Cognito, or Cloudflare Access? There are several compelling reasons to self-host:
Data sovereignty. Your authentication data — user identities, registered devices, audit logs — stays on your infrastructure. You control retention policies, access controls, and compliance boundaries. For organizations under GDPR, HIPAA, or other regulatory frameworks, this is often a hard requirement rather than a preference.
No vendor lock-in. Cloud identity providers create deep dependencies. Migrating user accounts, MFA enrollments, and session state between providers is notoriously difficult. Self-hosted solutions let you own the entire authentication stack and switch components as needed.
Cost at scale. Most cloud identity providers charge per monthly active user (MAU). A self-hosted solution runs on your existing infrastructure with predictable costs that do not scale linearly with user count.
Air-gapped and offline environments. Some deployments — industrial control systems, classified networks, edge computing nodes — simply cannot reach external identity services. Self-hosted passkey servers work entirely within your network perimeter.
Custom integration. When you control the authentication server, you can integrate it with internal systems: LDAP directories, HR databases, hardware security modules (HSMs), and custom policy engines that cloud providers do not support.
Understanding the FIDO2 / WebAuthn Architecture
Before comparing solutions, it helps to understand the underlying protocol. FIDO2 is a joint standard from the FIDO Alliance and W3C that consists of two components:
- WebAuthn — the browser API that websites use to register and authenticate passkeys
- CTAP (Client to Authenticator Protocol) — the protocol between the browser/device and the authenticator (security key, biometric sensor, or platform authenticator like Apple Secure Enclave)
The registration flow works like this:
- The user visits your application and clicks “Create Passkey”
- Your application sends a registration challenge to the browser via WebAuthn
- The browser communicates with the device authenticator (via CTAP)
- The authenticator generates a new key pair, stores the private key securely, and returns the public key plus a signed attestation
- Your application sends the public key and attestation to your passkey server for verification and storage
Authentication is the reverse:
- The user clicks “Sign In with Passkey”
- Your application sends an authentication challenge
- The browser asks the device authenticator to sign the challenge with the stored private key
- The authenticator signs it (after user verification — biometric, PIN, or security key touch)
- Your server verifies the signature using the stored public key
The critical security property: the private key is never transmitted, never stored on the server, and never leaves the authenticator device. Even if your server is fully compromised, attackers cannot impersonate users.
Comparison: Self-Hosted Passkey Solutions in 2026
| Feature | Keycloak | Zitadel | Authentik | PassBolt + WebAuthn | go-webauthn (library) |
|---|---|---|---|---|---|
| Type | Full IdP | Cloud-native IdP | Identity provider | Password manager + plugin | Go library |
| WebAuthn Support | Native (since v17) | Native (first-class) | Native (since v2023) | Via community plugin | Embed in your app |
| Passkey (discoverable) | Yes | Yes | Yes | Limited | Yes |
| FIDO2 / CTAP2 | Yes | Yes | Yes | No | Yes |
| Admin Console | Rich web UI | Rich web UI | Rich web UI | Web UI | None (code-level) |
| OIDC / SAML | Full support | Full support | Full support | No (separate) | No (library) |
| Multi-tenancy | Via realms | Built-in | Via contexts | No | No |
| Database | PostgreSQL, MySQL, MariaDB | PostgreSQL, CockroachDB | PostgreSQL, SQLite | MySQL, MaridockerYour choice | |
| Docker Support | Official images | Official images | Official images | Official images | N/A |
| License | Apache 2.0 | Apache 2.0 | MIT | AGPL 3.0 | Apache 2.0 |
| Best For | Enterprise, legacy integration | Modern cloud-native apps | Homelab, full-stack auth | Existing Passkey users | Developers building custom auth |
Keycloak: The Enterprise Identity Powerhouse
Keycloak is the most mature open-source identity and access management solution. Maintained by Red Hat and the community, it supports WebAuthn and passkeys natively since version 17 (the Quarkus-based rewrite).
Why Choose Keycloak
Keycloak is the right choice when you need a full-featured identity provider with extensive protocol support (OIDC, SAML, OAuth2, LDAP federation) and a proven track record in enterprise environments. Its WebAuthn implementation supports both platform authenticators (Touch ID, Windows Hello) and roaming authenticators (YubiKey, SoloKey).
Docker Deployment
| |
| |
Enabling Passkeys in Keycloak
After deployment, configure passkey authentication through the admin console:
- Navigate to Authentication > Policies > WebAuthn Policy
- Set Attestation Conveyance to
not specified(ordirectfor enterprise attestation) - Set Authenticator Attachment to
not specified(allows both platform and roaming) - Set User verification requirement to
requiredfor passwordless flows - Enable the WebAuthn Passwordless authentication flow
- Assign the flow to your application or realm
Application Integration
Keycloak provides OIDC endpoints that any WebAuthn-compatible application can use:
| |
The acr_values=fido2 parameter signals that the authentication must use WebAuthn/passkey.
Zitadel: Cloud-Native Identity Built for Developers
Zitadel takes a different approach. Built from the ground up as a cloud-native identity platform, it treats passkeys as a first-class citizen rather than an add-on feature. Its architecture is designed for multi-tenancy, audit trails, and horizontal scaling.
Why Choose Zitadel
Zitadel is ideal for teams building modern applications that need passkey-first authentication, granular multi-tenant identity management, and comprehensive audit logging out of the box. Its Go-based architecture is lightweight and scales well on Kubernetes.
Docker Deployment
| |
Generate a secure master key:
| |
Passkey Configuration in Zitadel
Zitadel enables passkeys through its organization settings:
- Go to Organization > Settings > Login Settings
- Enable Allow Passkey authentication
- Set Passkey enforcement to
optional(users can choose) orrequired(passwordless-only) - Configure allowed origins under WebAuthn Settings
- Create an application under Applications > OIDC to get client credentials
Integration Example
| |
Authentik: The Homelab and SMB Favorite
Authentik has rapidly gained popularity in the homelab and small-to-medium business space. It provides a complete identity provider with WebAuthn support, a flexible policy engine, and excellent integration with common homelab tools (Proxmox, nextcloud, Gitea, etc.).
Why Choose Authentik
Authentik stands out for its user-friendly interface, flexible flow/policy system, and broad ecosystem integrations. It supports passkeys alongside traditional password and OTP authentication, giving users a migration path. Its MIT license is also more permissive than Keycloak’s or Passkey’s licenses.
Docker Deployment
| |
Generate required secrets:
| |
Configuring WebAuthn in Authentik
- Access the admin interface at
https://your-server:9443/if/admin/ - Navigate to Flows > Stages and locate the Authenticator WebAuthn Setup stage
- Edit the stage to configure:
- User verification:
required(forces biometric/PIN) orpreferred - Authenticator attachment:
platform(built-in) orcross-platform(USB keys) - Resident key requirement:
requiredfor discoverable passkeys
- User verification:
- Add the WebAuthn stage to your authentication flow
- Navigate to Applications > Providers and create an OAuth2/OIDC provider
Policy Engine
Authentik’s policy engine is one of its strongest features. You can create conditional flows like:
| |
This is configured entirely through the web UI without writing code.
Building a Custom WebAuthn Server with Go
If none of the full-featured identity providers fit your needs, you can embed WebAuthn directly into your application using the go-webauthn library. This approach gives you complete control over the authentication flow, user experience, and data storage.
Project Setup
| |
Core Implementation
| |
This gives you a minimal but functional WebAuthn server. You would need to implement findUserFromSession, saveSession, loadSession, and saveUser using your preferred database.
Security Best Practices for Self-Hosted Passkey Infrastructure
Running your own authentication infrastructure means you own the security responsibilities. Here are critical practices to implement:
1. TLS is Mandatory
WebAuthn requires a secure context. Your authentication server must serve HTTPS with a valid certificate. Use Let’s Encrypt with automated renewal, or an internal CA for private networks.
| |
2. Database Encryption at Rest
Your passkey server stores public keys and attestation data. While public keys alone cannot impersonate users, the full authentication record is sensitive data. Encrypt your database:
| |
3. Rate Limiting and Anomaly Detection
Even with passkeys, you should protect against enumeration attacks (probing for valid usernames) and replay attacks.
| |
4. Audit Logging
Maintain detailed logs of all authentication events. Both Zitadel and Authentik include audit logging; Keycloak supports it via event listeners. For custom implementations, log:
- Registration attempts (success/failure, timestamp, user agent, IP)
- Authentication attempts (same fields)
- Credential deletions and modifications
- Admin configuration changes
5. Backup and Disaster Recovery
Your authentication database is critical infrastructure. Implement automated backups:
| |
Store backups off-site and test restoration procedures quarterly.
Migration Strategy: From Passwords to Passkeys
Moving your user base from passwords to passkeys requires a thoughtful migration strategy. The best approach is a gradual, opt-in transition:
Phase 1 — Offer passkeys as an option. Add a “Register a Passkey” button alongside the existing password login. Users who register a passkey can use it as a second factor.
Phase 2 — Encourage passkey adoption. Send email campaigns explaining the benefits. Offer incentives (reduced friction, faster login). Track adoption metrics.
Phase 3 — Make passkeys primary. For users with registered passkeys, default to passkey authentication. Offer password login as a fallback with clear messaging encouraging passkey migration.
Phase 4 — Passwordless default. New accounts are passkey-only. Existing password-only accounts receive periodic prompts to register a passkey. Eventually sunset password authentication.
Keycloak and Authentik both support this gradual approach by allowing you to configure multiple authentication methods in parallel and control which methods are required for which user groups.
Conclusion
Self-hosted passkey authentication is no longer a niche project — it is a practical, production-ready strategy for organizations that value security, privacy, and independence from cloud identity vendors. In 2026, the options are mature:
- Keycloak for enterprise-grade identity management with the broadest protocol support
- Zitadel for modern, cloud-native applications with passkey-first design
- Authentik for homelabs, SMBs, and teams that value flexibility and ease of use
- go-webauthn (or equivalent libraries in other languages) for developers who want complete control
All of these solutions eliminate the fundamental weakness of password-based authentication while giving you full ownership of your identity infrastructure. The investment in self-hosting pays dividends in security, compliance, and cost — especially as your user base grows.
Frequently Asked Questions (FAQ)
Which one should I choose in 2026?
The best choice depends on your specific requirements:
- For beginners: Start with the simplest option that covers your core use case
- For production: Choose the solution with the most active community and documentation
- For teams: Look for collaboration features and user management
- For privacy: Prefer fully open-source, self-hosted options with no telemetry
Refer to the comparison table above for detailed feature breakdowns.
Can I migrate between these tools?
Most tools support data import/export. Always:
- Backup your current data
- Test the migration on a staging environment
- Check official migration guides in the documentation
Are there free versions available?
All tools in this guide offer free, open-source editions. Some also provide paid plans with additional features, priority support, or managed hosting.
How do I get started?
- Review the comparison table to identify your requirements
- Visit the official documentation (links provided above)
- Start with a Docker Compose setup for easy testing
- Join the community forums for troubleshooting