2021-02-27 15:00:05 +00:00
---
2023-05-19 13:54:04 +00:00
title: I can't log in to authentik
2021-02-27 15:00:05 +00:00
---
In case you can't login anymore, perhaps due to an incorrectly configured stage or a failed flow import, you can create a recovery key.
:::caution
This recovery key will give whoever has the link direct access to your instances. Keep this key safe.
:::
To create the key, run the following command:
```
2023-12-07 08:26:44 +00:00
docker-compose run --rm server create_recovery_key 10 akadmin
2021-02-27 15:00:05 +00:00
```
2023-06-05 09:16:53 +00:00
For Kubernetes, run
2021-02-27 15:00:05 +00:00
```
2023-12-07 08:26:44 +00:00
kubectl exec -it deployment/authentik-worker -c authentik -- ak create_recovery_key 10 akadmin
2021-02-27 15:00:05 +00:00
```
2023-06-05 09:16:53 +00:00
or, for CLI, run
```
2023-12-07 08:26:44 +00:00
ak create_recovery_key 10 akadmin
2023-06-05 09:16:53 +00:00
```
2021-02-27 15:00:05 +00:00
This will output a link, that can be used to instantly gain access to authentik as the user specified above. The link is valid for amount of years specified above, in this case, 10 years.