Self-hosting

Lunary was designed to be surprisingly simple to self-host, through a Helm Chart which include the frontend, the api and workers.

Steps

1

Set up a PostgreSQL database

Set up a PostgreSQL database to store your Lunary data (version 15 or higher).

2

Log in to the private Docker Repository

Run the following command:

helm registry login registry-1.docker.io -u lunarycustomer -p <your_organization_access_token>

Your Organization's Access Token, will be provided by Lunary when your subscription is activated.

3

Download the Helm Chart

kubectl create ns lunary
helm pull oci://registry-1.docker.io/lunary/lunary --untar --version '1.2.2' # versions are available here: https://github.com/lunary-ai/lunary/releases
4

Set up mandatory secrets

kubectl create secret -n lunary docker-registry regcred --docker-server=docker.io --docker-username=lunarycustomer --docker-password=<your_organization_access_token>
kubectl create secret -n lunary generic db-connection --from-literal=url="postgres://<username>:<password>@<host>:5432/lunary"
kubectl create secret -n lunary generic license-key --from-literal=LICENSE_KEY='<license_key>'
kubectl create secret -n lunary generic jwt-secret --from-literal=JWT_SECRET='<jwt_secret>' # You can generate a random string using `openssl rand -base64 32`

Your License Key will be provided by Lunary when your subscription is activated. The Organization Access Token is the same as the one you used to log in with helm login.

5

(Optional) Set up API Keys

In order to use the Prompts, Radars and Evaluations features, you need to at least one of the following secrets:

kubectl create secret -n lunary generic api-keys \
--from-literal=OPENAI_API_KEY='<your-openai-api-key>' \
--from-literal=ANTHROPIC_API_KEY='<your-anthropic-api-key>' \
--from-literal=OPENROUTER_API_KEY='<your-openrouter-api-key>' \
--from-literal=PALM_API_KEY='<your-palm-api-key>'

Then, configure the corresponding values in values.yaml, in the Helm Chart's root directory:

--
global:
...
secrets:
useOpenAI: true
useAnthropic: true
useOpenRouter: true
usePalm: true
...
6

Install the Helm Chart

cd lunary
helm upgrade --install -n lunary lunary .
7

🎉 Done!

The Helm Chart should be installed and ready to go.
You can now set up a ingress controller to expose the services.

Questions? We're here to help.