lemon-student-13425
08/21/2024, 4:56 PMchilly-king-10285
08/21/2024, 4:56 PMchilly-king-10285
08/21/2024, 4:56 PMbash useradd -s /bin/false -m -d /opt/kratos kratos
2. Create folders to hold the installation data and configuration files: bash mkdir /opt/kratos/{bin,config}
3. Install Ory Kratos: bash cd /opt/kratos/bin wget <https://github.com/ory/kratos/releases/download/<version-you-want>/kratos_<version-you-want>-linux_64bit.tar.gz> tar xfvz kratos_<version-you-want>-linux_64bit.tar.gz rm *md rm LICENSE
4. Download the Quickstart configuration files: bash cd ../config wget <https://raw.githubusercontent.com/ory/kratos/<version-you-want>/contrib/quickstart/kratos/email-password/identity.schema.json> wget <https://raw.githubusercontent.com/ory/kratos/<version-you-want>/contrib/quickstart/kratos/email-password/kratos.yml>
5. Add configuration for Ory Kratos in kratos.yml
to use the Postgres database. Open kratos.yml
and change the dsn configuration. By default dsn: memory
is configured, so Ory Kratos is storing data in the temporary memory. Change the DSN key to use the Postgres database you configured before: bash - dsn: memory + dsn: <postgres://kratos:[email> protected]:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4
6. Change the default location of the identity schema: bash identity: default_schema_id: default schemas: - id: default - url: file:///etc/kratos/config/identity.schema.json + url: file:///opt/kratos/config/identity.schema.json
7. Apply migrations: bash /opt/kratos/bin/kratos -c /opt/kratos/config/kratos.yml migrate sql -y <postgres://kratos:[email> protected]:5432/kratos?sslmode=disable
8. Test your setup using the serve
command: bash /opt/kratos/bin/kratos -c /opt/kratos/config/kratos.yml serve
You should see something like this once the service has been started: bash INFO[2022-05-10T20:51:56Z] TLS has not been configured for public, skipping audience=application service_name=Ory Kratos service_version=<version-you-want> INFO[2022-05-10T20:51:56Z] Starting the public httpd on: 0.0.0.0:4433 audience=application service_name=Ory Kratos service_version=<version-you-want> INFO[2022-05-10T20:51:56Z] TLS has not been configured for admin, skipping audience=application service_name=Ory Kratos service_version=<version-you-want> INFO[2022-05-10T20:51:56Z] Starting the admin httpd on: 0.0.0.0:4434 audience=application service_name=Ory Kratos service_version=<version-you-want>
Please replace <version-you-want>
with the version of Ory Kratos