Shlink logo

Shlink

The definitive self-hosted URL shortener

Alternative to: bitly, tinyurl, rebrandly

Shlink screenshot

Shlink is a self-hosted URL shortener that lets you serve shortened links under your own domain, with a REST API and CLI at its core. Paired with its official web client, it provides a full dashboard for creating and managing short URLs with custom slugs, expiry dates and visit limits, browsing detailed visit analytics (referrers, device, browser and geolocation), organizing links with tags across multiple domains, and generating customizable QR codes.

Shlink Docker Compose example

Self-host Shlink on your own server, homelab, or VPS starting from this Docker Compose example. It runs Shlink in Docker containers using the official shlinkio/shlink:stable image, with persistent volumes and automatic restarts preconfigured. Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.

services:
  shlink:
    image: shlinkio/shlink:stable
    restart: unless-stopped
    environment:
      # The default short domain for this Shlink instance (e.g. s.example.com).
      DEFAULT_DOMAIN: "changeme"
      # Whether short URLs are served over HTTPS (true) or plain HTTP (false).
      IS_HTTPS_ENABLED: "true"
      # Optional GeoLite2 license key enabling visit geolocation. Leave empty to disable.
      GEOLITE_LICENSE_KEY: ""
      # Optional API key created on first start. Leave empty to generate one later via the CLI.
      INITIAL_API_KEY: ""
    volumes:
      - data:/etc/shlink/data

volumes:
  data:

Values set to changeme are required — replace them with your own values before starting Shlink.

Prefer a managed setup? WinterFlow installs, configures, and updates Shlink for you using this same Docker Compose configuration.