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

# Deploy with drim CLI

> Deploy and manage a self-hosted Kaneo instance with the drim CLI

## What is drim?

[drim](https://github.com/usekaneo/drim) is a CLI tool for deploying Kaneo. It generates your `docker-compose.yml`, `Caddyfile` and `.env`, installs Docker if it is missing, and brings the stack up, so a fresh server goes from nothing to a running instance in one command.

It suits straightforward deployments. If you need a custom topology, extra services, or your own reverse proxy, [Docker Compose](/docs/core/installation/docker-compose) gives you more control.

## Installation

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
curl -fsSL https://assets.kaneo.app/install.sh | sh
```

Or download a binary from [releases](https://github.com/usekaneo/drim/releases/latest).

### Install script options

| Option            | Description                              |
| ----------------- | ---------------------------------------- |
| `--silent`        | Suppress output                          |
| `--setup`         | Run `drim setup` after installing        |
| `--domain=DOMAIN` | Deploy on this domain, implies `--setup` |

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# Install, deploy, and configure HTTPS for a domain in one command
curl -fsSL https://assets.kaneo.app/install.sh | sh -s -- --setup --domain=kaneo.example.com
```

The script detects your platform, downloads the matching binary, and installs it to `/usr/local/bin`. It supports Linux and macOS on amd64 and arm64, and Windows through WSL.

## Quick start

### Interactive

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
drim setup
```

You are asked whether to use the bundled Caddy reverse proxy, and for a domain. Leave the domain empty for a local deployment, reachable at `http://localhost`, or `http://localhost:5173` when you skip the reverse proxy.

### Non-interactive

Pass the configuration as flags to skip the prompts, which is what you want in a script or over SSH without a terminal:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
drim setup --domain=kaneo.example.com
drim setup --no-reverse-proxy
```

<Info>
  Point your domain's DNS A record at the server before running setup. Caddy requests a certificate immediately, and that only succeeds once the record resolves.
</Info>

## Commands

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
drim setup       # Deploy Kaneo
drim start       # Start services
drim stop        # Stop services
drim restart     # Restart services
drim upgrade     # Pull the latest Kaneo images and restart
drim update      # Update the drim CLI itself
drim configure   # Edit .env, then apply the changes
drim uninstall   # Remove Kaneo
```

Run these from the directory holding your `docker-compose.yml`. drim tells you when it cannot find a deployment there.

`drim restart` restarts the containers. Because services read configuration through `env_file`, a plain restart reuses the environment a container was created with, so use `drim restart --recreate` to recreate containers and pick up `.env` changes. `drim configure` already does this for you.

## What gets installed

* **PostgreSQL 16**, the database
* **Kaneo**, the API and web app in a single container
* **Caddy**, the reverse proxy with automatic HTTPS, unless you pass `--no-reverse-proxy`

Services run with health checks and restart automatically unless explicitly stopped. PostgreSQL is only reachable on the internal Docker network, never published to the host.

## Configuration

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
drim configure
```

This opens `.env` in `$EDITOR` (or nano). After saving, drim offers to apply the changes, which recreates the containers so the new values take effect.

`drim setup` writes the variables Kaneo requires. Optional features are enabled by adding their variables, for example:

```env theme={"theme":{"light":"min-light","dark":"min-dark"}}
# GitHub sign-in
GITHUB_OAUTH_CLIENT_ID=your_client_id
GITHUB_OAUTH_CLIENT_SECRET=your_client_secret

# Email
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=you@example.com
SMTP_PASSWORD=your-password
SMTP_FROM=you@example.com

# Redis pub/sub, for running more than one API replica
REDIS_URL=redis://your-redis-host:6379
```

See [environment variables](/docs/core/installation/environment-variables) for the full list.

## Requirements

* Docker 20.10+ and Docker Compose V2
* 2GB RAM and 10GB disk
* A public DNS record, for production deployments

drim installs Docker automatically on supported Linux distributions. When it does, it also adds your user to the `docker` group and stops, because group membership only applies to a new login session. Log out, log back in, and run `drim setup` again.

If Docker is already installed but you are not in the `docker` group, setup tells you so before writing any files, along with the command to fix it:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
sudo usermod -aG docker $USER
```

## Upgrading

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
drim upgrade
```

This pulls the latest images and restarts the changed services. Your data lives in Docker volumes and is not touched.

To update drim itself:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
drim update
```

<Warning>
  Deployments created before Kaneo moved to a single container still run the older two-image layout, and `drim upgrade` does not rewrite an existing `docker-compose.yml`. See [migrating to drim](/docs/core/installation/drim-migration) to move to the current layout.
</Warning>

## Building from source

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
git clone https://github.com/usekaneo/drim.git
cd drim
go build -o drim .
```

`make build-all` cross-compiles for every supported platform.

## Getting help

* [Report an issue](https://github.com/usekaneo/drim/issues)
* [Discord](https://discord.gg/rU4tSyhXXU)
