MirrorNest
← Tutte le guide

Shlink

A self-hosted URL shortener with a full REST API, visit-tracking analytics, and an optional web UI (Shlink Web Client) — your own private bit.ly.

Sistema: Any Docker hostURL-shortenerself-hostedDockerSito ufficiale ↗Documentazione ufficiale ↗
Questa guida è redatta a partire dalla documentazione ufficiale di Shlink, linkata sopra — verifica sempre lì i nomi esatti di pacchetti/versioni prima di eseguire questi comandi su un server di produzione, poiché le versioni della distribuzione e del progetto cambiano nel tempo.
  1. 1Run the Shlink server container

    Set your own domain as DEFAULT_DOMAIN so generated short links use it instead of a placeholder.

    docker run -d \ --name shlink \ -p 8082:8080 \ -e DEFAULT_DOMAIN=links.yourdomain.com \ -e IS_HTTPS_ENABLED=true \ -v ./shlink/data:/etc/shlink/data \ --restart unless-stopped \ shlinkio/shlink:stable
  2. 2Generate an API key

    Shlink has no built-in login UI on its own -- the server is API-first, so you create an API key from inside the running container.

    docker exec -it shlink shlink api-key:generate
  3. 3Run the Shlink Web Client (optional)

    A separate official container gives you a normal web dashboard for creating and managing short links using the API key from the previous step.

    docker run -d --name shlink-web-client -p 8083:8080 --restart unless-stopped shlinkio/shlink-web-client:stable