mirror of
https://github.com/goauthentik/authentik
synced 2026-04-25 17:15:26 +02:00
* initial Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use same startup template Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix check not working Signed-off-by: Jens Langhammer <jens@goauthentik.io> * unrelated: fix inspector auth Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update docs Signed-off-by: Jens Langhammer <jens@goauthentik.io> * ensure oobe flow can only accessed via correct url Signed-off-by: Jens Langhammer <jens@goauthentik.io> * set setup flag when applying bootstrap blueprint when env is set Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add system visibility to flags to make them non-editable Signed-off-by: Jens Langhammer <jens@goauthentik.io> * set setup flag for e2e tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix tests and linting Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * make github lint happy Signed-off-by: Jens Langhammer <jens@goauthentik.io> * make tests have less assumptions Signed-off-by: Jens Langhammer <jens@goauthentik.io> * Update docs * include more heuristics in migration Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add management command to set any flag Signed-off-by: Jens Langhammer <jens@goauthentik.io> * migrate worker command to signal Signed-off-by: Jens Langhammer <jens@goauthentik.io> * improved api for setting flags Signed-off-by: Jens Langhammer <jens@goauthentik.io> * short circuit Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Dewi Roberts <dewi@goauthentik.io>
132 lines
5.3 KiB
Plaintext
132 lines
5.3 KiB
Plaintext
---
|
|
title: Docker Compose installation
|
|
---
|
|
|
|
This installation method is for test setups and small-scale production setups.
|
|
|
|
## Requirements
|
|
|
|
- A host with at least 2 CPU cores and 2 GB of RAM
|
|
- Podman or Docker Compose (Compose v2, see [instructions for upgrade](https://docs.docker.com/compose/migrate/))
|
|
|
|
## Video
|
|
|
|
View our video about installing authentik on Docker.
|
|
|
|
<iframe
|
|
width="560"
|
|
height="315"
|
|
src="https://www.youtube.com/embed/O1qUbrk4Yc8?si=HiSBjmJYhE_oJhB1&start=22"
|
|
title="YouTube video player"
|
|
frameBorder="0"
|
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
|
allowFullScreen
|
|
></iframe>
|
|
|
|
## Download the Compose file
|
|
|
|
To download the latest `compose.yml` open your terminal, navigate to the directory of your choice, and then run the following command:
|
|
|
|
import TabItem from "@theme/TabItem";
|
|
import Tabs from "@theme/Tabs";
|
|
|
|
{/* prettier-ignore */}
|
|
<Tabs groupId="OS">
|
|
<TabItem value="Linux" label="Linux" default>
|
|
```shell
|
|
wget https://docs.goauthentik.io/compose.yml
|
|
```
|
|
</TabItem>
|
|
<TabItem value="macOS" label="macOS">
|
|
```shell
|
|
curl -O https://docs.goauthentik.io/compose.yml
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
## Generate PostgreSQL password and secret key
|
|
|
|
If this is a fresh authentik installation, generate a PostgreSQL password and an authentik secret key. Use a secure password generator of your choice such as `pwgen`, or use `openssl` as shown below.
|
|
|
|
Run the following commands to generate a PostgreSQL password and secret key and write them to your `.env` file:
|
|
|
|
{/* prettier-ignore */}
|
|
```shell
|
|
echo "PG_PASS=$(openssl rand -base64 36 | tr -d '\n')" >> .env
|
|
echo "AUTHENTIK_SECRET_KEY=$(openssl rand -base64 60 | tr -d '\n')" >> .env
|
|
```
|
|
|
|
:::info
|
|
Because of a PostgreSQL limitation, passwords longer than 99 characters are not supported. See the [PostgreSQL mailing list discussion](https://www.postgresql.org/message-id/09512C4F-8CB9-4021-B455-EF4C4F0D55A0@amazon.com).
|
|
:::
|
|
|
|
To enable error reporting, run the following command:
|
|
|
|
```shell
|
|
echo "AUTHENTIK_ERROR_REPORTING__ENABLED=true" >> .env
|
|
```
|
|
|
|
For an explanation about what each service in the Docker Compose file does, see [Architecture](../../core/architecture.md).
|
|
|
|
## Configure custom ports
|
|
|
|
By default, authentik listens internally on port 9000 for HTTP and 9443 for HTTPS. To use different exposed ports such as 80 and 443, you can set the following variables in `.env`:
|
|
|
|
```shell
|
|
COMPOSE_PORT_HTTP=80
|
|
COMPOSE_PORT_HTTPS=443
|
|
```
|
|
|
|
See [Configuration](../configuration/configuration.mdx) to change the internal ports. Be sure to run `docker compose up -d` to rebuild with the new port numbers.
|
|
|
|
## Docker socket
|
|
|
|
By default, the authentik Docker Compose file mounts the Docker socket to the authentik worker container:
|
|
|
|
```yaml
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
```
|
|
|
|
This is used for [automatic deployment and management of authentik Outposts](../../add-secure-apps/outposts/integrations/docker.md).
|
|
|
|
Mounting the Docker socket to a container comes with some inherent security risks. To reduce these risks, you can use a [Docker Socket Proxy](../../add-secure-apps/outposts/integrations/docker.md#docker-socket-proxy) as an additional layer of protection.
|
|
|
|
Alternatively, you can remove this mount and instead [manually deploy and manage outposts](../../add-secure-apps/outposts/manual-deploy-docker-compose.md).
|
|
|
|
## Email configuration (optional but recommended)
|
|
|
|
It is also recommended to configure global email settings. These are used by authentik to notify administrators about alerts, configuration issues and new releases. They can also be used by [Email stages](../../add-secure-apps/flows-stages/stages/email/index.mdx) to send verification/recovery emails.
|
|
|
|
For more information, refer to our [Email configuration](../email.mdx) documentation.
|
|
|
|
## Install and start authentik
|
|
|
|
:::warning
|
|
All internal operations use UTC. Times displayed in the UI are automatically localized for the user. Do not update or mount `/etc/timezone` or `/etc/localtime` in the authentik containers; it will cause problems with OAuth and SAML authentication, as seen this [GitHub issue](https://github.com/goauthentik/authentik/issues/3005).
|
|
:::
|
|
|
|
After you have downloaded the `docker-compose.yml` file, generated a password and a secret key, and optionally configured your global email, run these commands to retrieve and install the current version of authentik:
|
|
|
|
```shell
|
|
docker compose pull
|
|
docker compose up -d
|
|
```
|
|
|
|
The `compose.yml` file statically references the latest version available at the time of downloading the compose file. Each time you upgrade to a newer version of authentik, you download a new `compose.yml` file, which points to the latest available version. For more information, refer to the **Upgrading** section in the [Release Notes](../../../releases/).
|
|
|
|
## Access authentik
|
|
|
|
To start the initial setup, navigate to `http://<your server's IP or hostname>:9000`.
|
|
|
|
You are then prompted to set a password for the `akadmin` user (the default user).
|
|
|
|
:::info Issues with initial setup
|
|
If you run into issues, refer to our [troubleshooting docs](../../troubleshooting/login.md#cant-access-initial-setup-flow-during-installation-steps).
|
|
:::
|
|
|
|
## First steps in authentik
|
|
|
|
import BlurbFirstSteps from "../first-steps/_blurb_first_steps.mdx";
|
|
|
|
<BlurbFirstSteps />
|