kanidm/kanidm_book/src/server_configuration.md

40 lines
1.3 KiB
Markdown
Raw Normal View History

## Configuring the Server
### Configuring server.toml
You need a configuration file in the volume named `server.toml`. (Within the container it should be `/data/server.toml`) Its contents should be as follows:
```
{{#rustdoc_include ../../examples/server_container.toml}}
```
2021-08-22 08:05:28 +02:00
This example is located in [examples/server_container.toml](https://github.com/kanidm/kanidm/blob/master/examples/server_container.toml).
2022-09-02 06:21:20 +02:00
{{#template
templates/kani-warning.md
imagepath=images
title=Warning!
text=You MUST set the `domain` name correctly, aligned with your `origin`, else the server may refuse to start or some features (e.g. webauthn, oauth) may not work correctly!
}}
2022-05-01 05:34:19 +02:00
### Check the configuration is valid.
2022-05-01 05:34:19 +02:00
You should test your configuration is valid before you proceed.
docker run --rm -i -t -v kanidmd:/data \
2022-05-01 05:34:19 +02:00
kanidm/server:latest /sbin/kanidmd configtest -c /data/server.toml
### Default Admin Account
Then you can setup the initial admin account and initialise the database into your volume.
2022-05-01 05:34:19 +02:00
docker run --rm -i -t -v kanidmd:/data \
kanidm/server:latest /sbin/kanidmd recover_account -c /data/server.toml admin
### Run the Server
Now we can run the server so that it can accept connections. This defaults to using `-c /data/server.toml`
2021-07-31 09:13:46 +02:00
docker run -p 8443:8443 -v kanidmd:/data kanidm/server:latest