MirrorNest
← Todos os guias

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.

Destino: Any Docker hostURL-shortenerself-hostedDockerSite oficial ↗Documentação oficial ↗
Este guia foi elaborado a partir da documentação oficial do Shlink, ligada acima — verifique sempre lá os nomes exatos dos pacotes/versões antes de executar estes comandos num servidor de produção, uma vez que as versões da distribuição e do projeto mudam com o 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