We need node.js, npm and wget installed in order to get Kalmia working. You can follow the guide here for installing node js. On debian using apt you can install wget and like this:
All you have to do is go to the releases page and download the latest binary for your platform, as of writing the binary we would use is this one. Now we're going to assume you have shell access on the machine you will be hosting Kalmia on. If so, just connect to the server via SSH.
Once you're connected over SSH you can just go ahead and navigate to ~/ which is basically your home directory, this can be anything, we're using ~/ for simplicity. You can run the following commands to create a new directory for Kalmia and also to download the binary.
Now the binary itself needs a config file to start working the format of which will be given in config.example.json, we will go over the options.
environment: For anything other than a dev environment it is imperative to use "production" here if you're not writing/contributing to kalmia.
port: Just a simple port number, choose something > 1024 as then you'd not need root privileges to run Kalmia.
database: You can use either sqlite or postgres. For sqlite you just have to specify "sqlite" and for postgres you need to give a connection string similar to this:
logLevel: We're still a 0.0.1 product, so leaving debug would be helpful just in case you encounter a bug and need our help to solve it! But other options such as "info", "error", "warn" are valid here.
sessionSecret: This is used in the generation of JWT tokens, make sure you use a long, random string here that is NOT the default one in the example config.
users: You can specify the initial users here. admin or not is determined by the boolean admin flag.
s3: ANY S3 compatible object store will work here, just fill out the details from your favorite one.
github/microsoft/google oauth: You can create one on their respective web interfaces and just copy in the credentials here.
Make sure you replace the node binary location in the environment block (/root/.nvm/versions/node/v20.16.0/bin) to the path of the binary in your system, you can find out where npm/node lives by using the command whereis:
whereisnpm
The above step is crucial as Kalmia uses npm and npx to build documentation. The service WILL panic if it doesn't find node, npm binaries.
Now this step is entirely optional but highly recommended. We're going to be running kalmia on port 2727, which means nginx would run on 443 and 80. This would be an example config for kalmia.difuse.io: