Try describing what you need:

Shlink logo

Shlink

★ 5.4k
MIT LicenseOpen Source — No Paywall15 Containers — 15 containers — heavy hosting footprintDocker · Binary · SourceNeeds MySQL5 active committers (12mo)

About

Shlink is a PHP-based URL shortener designed for self-hosting, allowing users to serve shortened links under their own domain. It targets operators who want control over their link infrastructure...

Community Ratings

No ratings yet
Shlink

Features

  • self-hosted URL shortening
  • custom domain hosting
  • REST API
  • command-line interface
  • API key management
  • web client
  • configurable via environment variables
  • sandboxed API docs

Details

Last Updated
Nov 26, 2026
Created
Apr 8, 2016
Install Methods
dockerbinarysource
Requirements
PHP 8.4 or 8.5PHP extensions: json, curl, pdo, intl, gd, gmp/bcmathapcu extension (recommended if not using RoadRunner)sockets and bcmath extensions (for RabbitMQ integration)MySQL, MariaDB, PostgreSQL, Microsoft SQL Server, or SQLitecorresponding PDO extension for the chosen database
Authentication
local
API
REST
Runtime / Stack
PHPDocker
Privacy & Independence
No Cloud Required
Deployment

Deployment: Docker Compose ✓15 Containers — heavy hosting footprintRuns as 15 containers

Run Shlink yourself

Pick how much you want to manage.

6 more ways to host

Some links earn us a commission. netcup pays us one and is our preferred VPS host. Hostinger is a paid sponsor and is listed first.

Is this your project? Sponsor a listing

Run Shlink with Docker Compose

Compose file from the Shlink project repository.

15 services · database: mysql · infra: nginx, mysql, postgres, mariadb, redis, rabbitmq · 4 unclassified (server, mercure, swagger-ui, matomo)

no resource limits declared

needs persistent storage (22 volumes)

docker-compose.yml · @ 2563b51 · scanned Nov 3, 2026

services:
    shlink_nginx:
        container_name: shlink_nginx
        image: nginx:1.25-alpine
        ports:
            - "8000:80"
        volumes:
            - ./:/home/shlink/www
            - ./docs:/home/shlink/www/public/docs
            - ./data/infra/vhost.conf:/etc/nginx/conf.d/default.conf
        links:
            - shlink_php

    shlink_php:
        container_name: shlink_php
        user: 1000:1000
        build:
            context: .
            dockerfile: ./data/infra/php.Dockerfile
        ports:
            - '8888:8888'
        volumes:
            - ./:/home/shlink/www
            - ./data/infra/php.ini:/usr/local/etc/php/php.ini
        links:
            - shlink_db_mysql
            - shlink_db_postgres
            - shlink_db_maria
            - shlink_db_ms
            - shlink_redis
            - shlink_redis_acl
            - shlink_mercure
            - shlink_mercure_proxy
            - shlink_rabbitmq
            - shlink_matomo
        environment:
            LC_ALL: C
            DEFAULT_DOMAIN: localhost:8000
        extra_hosts:
            - 'host.docker.internal:host-gateway'

    shlink_roadrunner:
        container_name: shlink_roadrunner
        user: 1000:1000
        build:
            context: .
            dockerfile: ./data/infra/roadrunner.Dockerfile
        ports:
            - "8800:8080"
        volumes:
            - ./:/home/shlink
            - ./data/infra/php.ini:/usr/local/etc/php/php.ini
        links:
            - shlink_db_mysql
            - shlink_db_postgres
            - shlink_db_maria
            - shlink_db_ms
            - shlink_redis
            - shlink_redis_acl
            - shlink_mercure
            - shlink_mercure_proxy
            - shlink_rabbitmq
            - shlink_matomo
        environment:
            LC_ALL: C
        extra_hosts:
            - 'host.docker.internal:host-gateway'

    shlink_frankenphp:
      container_name: shlink_frankenphp
      user: 1000:1000
      build:
        context: .
        dockerfile: ./data/infra/frankenphp.Dockerfile
      ports:
        - "8008:8008"
      volumes:
        - ./:/home/shlink
        - ./data/infra/php.ini:/usr/local/etc/php/php.ini
        - ./data/infra/frankenphp_caddy_data:/data
        - ./data/infra/frankenphp_caddy_config:/config
      links:
        - shlink_db_mysql
        - shlink_db_postgres
        - shlink_db_maria
        - shlink_db_ms
        - shlink_redis
        - shlink_redis_acl
        - shlink_mercure
        - shlink_mercure_proxy
        - shlink_rabbitmq
        - shlink_matomo
      environment:
        FRANKENPHP_CONFIG: 'worker /home/shlink/bin/frankenphp-worker.php'
        SERVER_NAME: ':8008 https:8009'
      extra_hosts:
        - 'host.docker.internal:host-gateway'
      tty: true

    shlink_db_mysql:
        container_name: shlink_db_mysql
        user: 1000:1000
        image: mysql:8.0
        ports:
            - "3307:3306"
        volumes:
            - ./:/home/shlink/www
            - ./data/infra/database:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: shlink

    shlink_db_postgres:
        container_name: shlink_db_postgres
        user: 1000:1000
        image: postgres:16.3-alpine
        ports:
            - "5434:5432"
        volumes:
            - ./:/home/shlink/www
            - ./data/infra/database_pg:/var/lib/postgresql/data
        environment:
            POSTGRES_PASSWORD: root
            POSTGRES_DB: shlink
            PGDATA: /var/lib/postgresql/data/pgdata

    shlink_db_maria:
        container_name: shlink_db_maria
        user: 1000:1000
        image: mariadb:10.7
        ports:
            - "3308:3306"
        volumes:
            - ./:/home/shlink/www
            - ./data/infra/database_maria:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: root
            MYSQL_DATABASE: shlink
            MYSQL_INITDB_SKIP_TZINFO: 1

    shlink_db_ms:
        container_name: shlink_db_ms
        image: mcr.microsoft.com/mssql/server:2022-latest
        ports:
            - "1433:1433"
        environment:
            ACCEPT_EULA: Y
            SA_PASSWORD: "Passw0rd!"

    shlink_redis:
        container_name: shlink_redis
        image: redis:7.4-alpine
        ports:
            - "6380:6379"

    shlink_redis_acl:
        container_name: shlink_redis_acl
        image: redis:7.4-alpine
        command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
        ports:
            - "6382:6379"
        volumes:
            - ./data/infra/redis/redis-acl.conf:/usr/local/etc/redis/redis.conf

    shlink_mercure_proxy:
        container_name: shlink_mercure_proxy
        image: nginx:1.25-alpine
        ports:
            - "8002:80"
        volumes:
            - ./:/home/shlink/www
            - ./data/infra/mercure_proxy_vhost.conf:/etc/nginx/conf.d/default.conf
        links:
            - shlink_mercure

    shlink_mercure:
        container_name: shlink_mercure
        image: dunglas/mercure:v0.18
        ports:
            - "3080:80"
        environment:
            SERVER_NAME: ":80"
            MERCURE_PUBLISHER_JWT_KEY: mercure_jwt_key_long_enough_to_avoid_error
            MERCURE_SUBSCRIBER_JWT_KEY: mercure_jwt_key_long_enough_to_avoid_error
            MERCURE_EXTRA_DIRECTIVES: "cors_origins https://app.shlink.io http://localhost:3000 http://127.0.0.1:3000 http://localhost:3002 http://127.0.0.1:3002 http://localhost:3005 http://127.0.0.1:3005"

    shlink_rabbitmq:
        container_name: shlink_rabbitmq
        image: rabbitmq:3.11-management-alpine
        ports:
            - "15673:15672"
            - "5673:5672"
        environment:
            RABBITMQ_DEFAULT_USER: "rabbit"
            RABBITMQ_DEFAULT_PASS: "rabbit"

    shlink_swagger_ui:
        container_name: shlink_swagger_ui
        image: swaggerapi/swagger-ui:v5.11.3
        ports:
            - "8005:8080"
        volumes:
            - ./docs/swagger:/app

    shlink_matomo:
        container_name: shlink_matomo
        image: matomo:5.0-apache
        ports:
            - "8003:80"
        volumes:
            # Matomo does not persist port in trusted hosts. This volume is needed to edit config afterward
            # https://github.com/matomo-org/matomo/issues/9549
            - ./data/infra/matomo:/var/www/html
        links:
            - shlink_db_mysql
        environment:
            MATOMO_DATABASE_HOST: "shlink_db_mysql"
            MATOMO_DATABASE_ADAPTER: "mysql"
            MATOMO_DATABASE_DBNAME: "matomo"
            MATOMO_DATABASE_USERNAME: "root"
            MATOMO_DATABASE_PASSWORD: "root"

This file may be out of date. Check the Shlink documentation for current setup steps.

Track your self-hosted stack

Bookmark software to try, rate tools you've used, and keep your collection in one place.

Metadata extracted from README on Mar 25, 2026

Alternatives to Shlink

YOURLS logo

YOURLS

12.3k
YOURLS is a self-hosted PHP URL shortener that runs on your own server.
URL ShortenersPermissive LicenseSelf Hosting Solutions+1
Details
Kutt logo

Kutt

11.2k
Kutt is a self-hosted URL shortener with custom domains, link management, private statistics, user administration, and a REST API.
URL ShortenersPermissive LicenseAnalytics Tools+2
Single Container
Details
Chhoto URL logo

Chhoto URL

1.0k
A simple self-hosted URL shortener focused on simplicity and speed.
URL ShortenersPermissive LicenseSelf Hosting Solutions+1
Details
Simple-URL-Shortener logo

Simple-URL-Shortener

60
A simple PHP URL shortener that works with MySQL or SQLite and supports comments on links.
URL ShortenersPermissive LicenseSelf Hosting Solutions+1
Details
Slash logo

Slash

3.2k
Slash is an open source, self-hosted platform for organizing, managing, and sharing link shortcuts.
Bookmark ManagementCopyleft LicenseURL Shorteners+2
Details
clink logo

clink

Super-minimal link shortening service written in pure C, focusing on small executable size, portability, and ease of configuration.
URL ShortenersCopyleft LicenseSelf Hosting Solutions+1
Details
Anchr logo

Anchr

397
Anchr is a self-hosted toolbox for bookmarks, link shortening, and encrypted image uploads.
Miscellaneous ToolsCopyleft LicenseBookmark Management+3
Details
Zipline logo

Zipline

3.5k
A self-hosted file upload server for sharing files, shortening URLs, and managing upload-related assets.
Simple File UploadsFile & Object StorageURL Shorteners+4
Details
rs-short logo

rs-short

5
Lightweight link shortener written in Rust, with features such as caching, spambot protection and phishing detection.
URL ShortenersCopyleft LicenseSelf Hosting Solutions+1
Details
rustypaste logo

rustypaste

1.2k
Rustypaste is a minimal self-hosted file upload and pastebin service that also supports URL shortening.
PastebinsPermissive LicenseSimple File Uploads+4
Single ContainerFully FOSS
Details

Related Software

XBackBone logo

XBackBone

1.2k
XBackBone is a self-hosted file and media sharing platform with ShareX support, rich previews, short links, and a REST API.
Simple File UploadsCopyleft LicenseWeb File Managers+5
Details
linkding logo

linkding

11.5k
linkding is a self-hosted bookmark manager designed to be minimal, fast, and easy to set up with Docker.
Bookmark ManagementPermissive LicenseKnowledge Management+2
Single Container
Details
Chiyogami logo

Chiyogami

81
Chiyogami is a self-hostable pastebin with encryption, configurable expiration, private pastes, user accounts, and an API.
PastebinsPermissive LicenseSelf Hosting Solutions
Single Container
Details
LittleLink logo

LittleLink

3.1k
A DIY self-hosted Linktree alternative with customizable branded buttons and themes.
Personal DashboardsPermissive LicenseWebsite Builders+1
Single ContainerTelemetry: Opt-Out
Details
Shaarli logo

Shaarli

3.9k
A personal, minimalist, database-free bookmarking and link-sharing service.
Bookmark ManagementPermissive LicenseSelf Hosting Solutions+1
2 Containers
Details
Shhh logo

Shhh

420
A tiny Flask app for creating encrypted secrets and sharing them securely via temporary links.
Custom CommunicationsPermissive LicenseSecret Management+2
Details
Umami logo

Umami

40.4k
Umami is a simple, fast, privacy-focused alternative to Google Analytics.
Analytics ToolsSelf Hosting SolutionsFully FOSS+1
Fully FOSS
Details