2020-02-29 07:43:59 +07:00
|
|
|
---
|
|
|
|
layout: default
|
|
|
|
title: PostgreSQL
|
2021-08-03 04:23:40 +07:00
|
|
|
parent: Storage Backends
|
2020-02-29 07:43:59 +07:00
|
|
|
grand_parent: Configuration
|
2020-03-27 06:43:10 +07:00
|
|
|
nav_order: 3
|
2020-02-29 07:43:59 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
# PostgreSQL
|
|
|
|
|
2021-04-11 18:25:03 +07:00
|
|
|
The PostgreSQL storage provider.
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2020-02-29 07:43:59 +07:00
|
|
|
```yaml
|
|
|
|
storage:
|
2020-04-11 11:46:07 +07:00
|
|
|
postgres:
|
|
|
|
host: 127.0.0.1
|
|
|
|
port: 5432
|
|
|
|
database: authelia
|
|
|
|
username: authelia
|
|
|
|
password: mypassword
|
2020-04-23 08:11:32 +07:00
|
|
|
sslmode: disable
|
2020-02-29 07:43:59 +07:00
|
|
|
```
|
2020-04-23 08:11:32 +07:00
|
|
|
|
2021-04-11 18:25:03 +07:00
|
|
|
## Options
|
|
|
|
|
|
|
|
### host
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
default: localhost
|
|
|
|
{: .label .label-config .label-blue }
|
|
|
|
required: no
|
|
|
|
{: .label .label-config .label-green }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The database server host.
|
2020-12-16 07:31:39 +07:00
|
|
|
|
2020-12-30 02:33:57 +07:00
|
|
|
If utilising an IPv6 literal address it must be enclosed by square brackets and quoted:
|
2020-12-16 07:31:39 +07:00
|
|
|
```yaml
|
|
|
|
host: "[fd00:1111:2222:3333::1]"
|
|
|
|
```
|
|
|
|
|
2021-04-11 18:25:03 +07:00
|
|
|
### port
|
|
|
|
<div markdown="1">
|
|
|
|
type: integer
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
default: 5432
|
|
|
|
{: .label .label-config .label-blue }
|
|
|
|
required: no
|
|
|
|
{: .label .label-config .label-green }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The port the database server is listening on.
|
|
|
|
|
|
|
|
### database
|
|
|
|
|
|
|
|
The database name on the database server that the assigned [user](#username) has access to for the purpose of
|
|
|
|
**Authelia**.
|
2020-04-23 08:11:32 +07:00
|
|
|
|
2021-04-11 18:25:03 +07:00
|
|
|
### username
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
required: yes
|
|
|
|
{: .label .label-config .label-red }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The username paired with the password used to connect to the database.
|
|
|
|
|
|
|
|
### password
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
required: yes
|
|
|
|
{: .label .label-config .label-red }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
The password paired with the username used to connect to the database. Can also be defined using a
|
|
|
|
[secret](../secrets.md) which is also the recommended way when running as a container.
|
|
|
|
|
|
|
|
### sslmode
|
|
|
|
<div markdown="1">
|
|
|
|
type: string
|
|
|
|
{: .label .label-config .label-purple }
|
|
|
|
default: disable
|
|
|
|
{: .label .label-config .label-blue }
|
|
|
|
required: no
|
|
|
|
{: .label .label-config .label-green }
|
|
|
|
</div>
|
|
|
|
|
|
|
|
SSL mode configures how to handle SSL connections with Postgres.
|
2020-04-23 08:11:32 +07:00
|
|
|
Valid options are 'disable', 'require', 'verify-ca', or 'verify-full'.
|
|
|
|
See the [PostgreSQL Documentation](https://www.postgresql.org/docs/12/libpq-ssl.html)
|
2021-04-11 18:25:03 +07:00
|
|
|
or [pgx - PostgreSQL Driver and Toolkit Documentation](https://pkg.go.dev/github.com/jackc/pgx?tab=doc)
|
2020-04-23 08:11:32 +07:00
|
|
|
for more information.
|