Aisle Websites & blogs

Shlink

Your own link shortener.

Add to my serverdocker-compose generator (French)Official documentation

What is it for?

Shlink creates short links on your domain (mydomain.com/promo) with click statistics, QR codes and custom slugs. Handy for social media, posters or affiliate links.

Who is it for?

People who share links a lot and want to know how many people click.

After installing

  1. Shlink has no built-in interface: use the official web app app.shlink.io, with your server address and the INITIAL_API_KEY from the .env file.
  2. Or create links from the command line: docker compose exec shlink shlink short-url:create

The docker-compose

Example behind Traefik. To adapt it (Nginx Proxy Manager, local port…) with a line-by-line explanation, use the generator (in French).

# docker-compose.yml : Shlink
services:
  shlink:
    image: shlinkio/shlink:stable
    container_name: shlink
    restart: unless-stopped
    environment:
      DEFAULT_DOMAIN: lien.mydomain.com
      IS_HTTPS_ENABLED: "true"
      INITIAL_API_KEY: "${INITIAL_API_KEY}"
      TZ: Europe/Paris
    volumes:
      - ./data:/etc/shlink/data
    networks:
      - traefik
    labels:
      - traefik.enable=true
      - traefik.http.routers.shlink.rule=Host(`lien.mydomain.com`)
      - traefik.http.routers.shlink.entrypoints=websecure
      - traefik.http.routers.shlink.tls.certresolver=letsencrypt
      - traefik.http.services.shlink.loadbalancer.server.port=8080

networks:
  traefik:
    external: true