# Self-host Shlink

> A self-hosted URL shortener with a full REST API for creating and tracking short links.

- Page: https://levelrail.com/templates/shlink/
- JSON: https://levelrail.com/templates/shlink.json
- Category: Developer Tools
- Licence: MIT (Permissive license)
- Source: https://github.com/shlinkio/shlink
- Upstream docs: https://shlink.io/documentation/

## Requirements
- Memory: about 128 MiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: stable

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| shlink | shlinkio/shlink | stable | 8080 | shlink_data -> /etc/shlink/data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| shlink | DEFAULT_DOMAIN | preset |
| shlink | IS_HTTPS_ENABLED | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy shlink --name my-shlink
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/shlink/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy Shlink 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 shlink for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image shlinkio/shlink:stable is what you deploy there.

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