Self-hosting

Lunary was designed to be surprisingly simple to self-host, through a Helm Chart which includes 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.11' # 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 one you used to log in with helm login.

5

(Optional) Set up API Keys and SMTP client

In order to use the Prompt Playground and Evaluations features, you need to set up at least one of the following secrets:

kubectl create secret -n lunary generic api-keys \
  --from-literal=OPENAI_API_KEY='<your-openai-api-key>' \
  # Or if using Azure
  --from-literal=AZURE_OPENAI_API_KEY='<your-azure-openai-api-key>' \
  --from-literal=AZURE_OPENAI_RESOURCE_NAME='<your-azure-openai-resource-name>' \
  --from-literal=AZURE_OPENAI_DEPLOYMENT_ID='<your-azure-openai-deployment-id>' \
  --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>'

You can also use your custom email server to send invitations to members of your organization:

kubectl create secret -n lunary generic smtp-config \
  --from-literal=EMAIL_SENDER_ADDRESS='<your-email-sender-address>' \
  --from-literal=SMTP_HOST='<your-smtp-host>' \
  --from-literal=SMTP_PORT='<your-smtp-port>' \
  --from-literal=SMTP_USER='<your-smtp-user>' \
  --from-literal=SMTP_PASSWORD='<your-smtp-password>

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

--
global:
  ... 
  secrets:
    useCustomSMTP: true
    useOpenAI: false
    useAzureOpenAI: 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 an ingress controller to expose the services.

Questions? We're here to help.

Email