website/docs/install-config/high-availability.mdx
High availability refers to system design that minimizes downtime even in the event of failures or disruptions.
authentik supports high availability in several ways:
authentik server and worker instances are stateless. All session state and configuration data is stored in the database. This statelessness makes it easy to horizontally scale authentik deployments by adding more server and worker instances, ensuring resilience and fault tolerance.
If a server or worker instance goes offline, another instance can continue to serve traffic. If these instances are distributed among multiple hosts, it can provide even higher levels of resilience and fault tolerance.
PostgreSQL provides high availability through replication and clustering.
Refer to the PostgreSQL High Availability, Load Balancing, and Replication documentation for more details.
authentik also has built-in support for PostgreSQL Read Replicas and using PostgreSQL Connection Poolers like PgBouncer or PgPool.
In an active-passive deployment, one authentik instance actively serves all requests while the other is on standby, prepared to assume control in the event of a failure.
The components of an active-passive authentik deployment include:
For more information on monitoring the health of an authentik instance, refer to the Monitoring documentation.
The following diagram shows a typical active-passive configuration:
graph TD
subgraph authentikInstances["authentik instances"]
A[Active authentik instance]@{stroke: #fd4b2d}
P[Passive authentik instance]@{stroke: #fd4b2d}
end
U[Users]@{ shape: processes}
L[Load Balancer]
PG[(PostgreSQL Cluster)]
U <-->|Traffic| L
L <-->|Traffic + Health monitoring| A
L ---|Health monitoring| P
A <-->|Database traffic - Read and Write| PG
P ---|Database traffic - Read only| PG
style A stroke: #fd4b2d,stroke-width:2px
style P stroke: #fd4b2d,stroke-width:2px
style authentikInstances stroke:#fd4b2d,stroke-width:2px
This setup provides several advantages: