# Self-host Kutt

> A modern URL shortener with custom domains, link analytics and an API, backed by Postgres and Redis.

- Page: https://levelrail.com/templates/kutt/
- JSON: https://levelrail.com/templates/kutt.json
- Category: Applications
- Licence: MIT (Permissive license)
- Source: https://github.com/thedevs-network/kutt
- Upstream docs: https://docs.kutt.it/

## Requirements
- Memory: about 384 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: 16-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | postgres | 16-alpine | none | pgdata -> /var/lib/postgresql/data |
| kutt | kutt/kutt | v3.2.6 | 3000 | uploads -> /kutt/custom |
| redis | redis | 7-alpine | none | redis -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | POSTGRES_DB | preset |
| db | POSTGRES_PASSWORD | generated |
| db | POSTGRES_USER | preset |
| kutt | DB_CLIENT | preset |
| kutt | DB_HOST | preset |
| kutt | DB_NAME | preset |
| kutt | DB_PASSWORD | generated |
| kutt | DB_PORT | preset |
| kutt | DB_USER | preset |
| kutt | DEFAULT_DOMAIN | preset |
| kutt | DISALLOW_ANONYMOUS_LINKS | preset |
| kutt | DISALLOW_REGISTRATION | preset |
| kutt | JWT_SECRET | generated |
| kutt | REDIS_ENABLED | preset |
| kutt | REDIS_HOST | preset |
| kutt | REDIS_PORT | preset |
| kutt | TRUST_PROXY | preset |

## Deploy

### CLI

```bash
levelrail-cli templates install kutt --name my-kutt
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain db=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/kutt/install \
  -d '{
    "name": "my-kutt"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## Questions

### Can I deploy Kutt on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id kutt for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, kutt/kutt:v3.2.6, redis:7-alpine is what you deploy there.

Self-host Kutt, Kutt docker compose file, deploy Kutt on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
