> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.krkn.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# First Time Setup

> Installing your krkns

## Aliasing and configuration setup

To start, use the krkns install command to create global aliases, enumerate environment variables and initialize the directories for the configurations.

<img src="https://mintcdn.com/krakentechllc/tlwFHVv__QJZ3K1b/images/image.png?fit=max&auto=format&n=tlwFHVv__QJZ3K1b&q=85&s=dff6cd02f85c76aa99f5ee07cf3c6c49" alt="Image" width="732" height="62" data-path="images/image.png" />

Optionally, if you would like to install Krkns as a service, you can now run the `service install` command. If the environment variables for `KRKN_DATA` or `TS_AUTHKEY` are set, thjis will add them to the service file defined. Otherwise you will need to define them after.

<Frame>
  <img src="https://mintcdn.com/krakentechllc/tlwFHVv__QJZ3K1b/images/image.png?fit=max&auto=format&n=tlwFHVv__QJZ3K1b&q=85&s=dff6cd02f85c76aa99f5ee07cf3c6c49" alt="Image" width="732" height="62" data-path="images/image.png" />
</Frame>

Next, you can configure settings using the `config get` and `config set` commands before starting the service. If you chose to run as a service you will first need to perform first time setup using the `krkns serve` command before enabling the service `systemctl --user enable --now krkn-server.service`)

Upon launching the Krkn Se~~r~~ver if a database does not yet exist, the user will be prompted to begin the first time setup process.

<img src="https://mintcdn.com/krakentechllc/dXkGMCpMKYcbLCWu/images/image-6.png?fit=max&auto=format&n=dXkGMCpMKYcbLCWu&q=85&s=948ee6c3bbeff948c4909e0a31094361" alt="Image" width="1520" height="1090" data-path="images/image-6.png" />

### Specifying a Sending Email

In order to begin a new Krkn server, a sending email must be provided.

Currently only the following SMTP Senders are implemented:

* Outlook
  * The app password can be generated at the [Microsoft Security Info](https://mysignins.microsoft.com/security-info) page.
* Google
  * The app password can be generated at the [App Passwords](https://myaccount.google.com/apppasswords) page.
* Mailgun
* Sengrid
* Standard SMTP
  * TLS
  * StartTLS

This sending email will be used to:

* Add new users to the Krkn Server.
* Reset user tokens

### Admin User

After selecting a sending email, the admin user must be created. To do so, we first supply a username followed by an email address.

Once the admin user information has been populated, a token email will be sent to the admin user from the sending email.

<img src="https://mintcdn.com/krakentechllc/kxycKQAOy1cuPZ5T/validation_required.png?fit=max&auto=format&n=kxycKQAOy1cuPZ5T&q=85&s=d48739de968da23c7c4c17bdfa3c1bef" alt="Validation Required" width="1518" height="1320" data-path="validation_required.png" />

### Confirming the Token

Once the token is received, the user can then provide it to the Krkn Server to verify receipt and initialize the server.

<img src="https://mintcdn.com/krakentechllc/dXkGMCpMKYcbLCWu/images/image-7.png?fit=max&auto=format&n=dXkGMCpMKYcbLCWu&q=85&s=0935001847294de71b604e9c00007845" alt="Image" width="2228" height="992" data-path="images/image-7.png" />

<img src="https://mintcdn.com/krakentechllc/3Pp70L3IOotR2kRa/images/Krkn-_80.png?fit=max&auto=format&n=3Pp70L3IOotR2kRa&q=85&s=bdbd8833187db3cc5a6ee7ddd5b814cc" alt="Krkn 80" width="1666" height="520" data-path="images/Krkn-_80.png" />
