mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-03 18:36:22 +00:00
- VOL_PATH always defaults to /data; vscode/opencode VOL_PROJECTS nests it - TZ defaults to America/Vancouver (was UTC in etherpad, ntfy, redis) - compose section order fixed (volumes before environment, command after networks) - all default secrets are the literal ChangeThisPassword (grep-friendly, users must change them); removed a real key from ollama sample.env - sample.env synced with compose: missing vars added with defaults, dead vars removed - invoiceninja_dev/openarchiver_dev: app services had no environment block, wired all sample.env vars through so the stacks actually work - opencode: sample.env OLLAMA_HOST renamed to OLLAMA_HOST_URL to match compose - TZ values unquoted consistently Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Shlink
Overview
Shlink is a self-hosted URL shortener with a REST API and web client for managing short links, tracking visits, and generating QR codes. This Docker Compose stack deploys Shlink with MariaDB, the web client, and an external reverse proxy.
Project Details
- Project Repository: Shlink
- Container Image: Docker Hub
- Compose Example: Official Docs
- Documentation: Docs
- Reverse Proxy Port:
8080(Shlink API),8003(web client)
Getting Started
- Copy
sample.envto.envand edit all values (especiallySHLINK_DOMAIN, database passwords) - Start the stack:
docker compose up -d - Access the Shlink REST API at http://localhost:8080
- Access the web client at http://localhost:8003
- Configure the web client with your Shlink server URL and API key (generate one via the CLI)
Environment Variable Notes
Compose
VOL_PATH– base path for persistent data (default:/data)SHLINK_IMAGE– Shlink image tag (default:shlinkio/shlink:latest)SHLINK_WEB_CLIENT_IMAGE– web client image tag (default:shlinkio/shlink-web-client:latest)SHLINK_RESTART– restart policy (default:unless-stopped)SHLINK_PORT– Shlink API host port (default:8080)SHLINK_WEB_CLIENT_PORT– web client host port (default:8003)
Database
MARIADB_IMAGE– MariaDB image tag (default:mariadb:10.11)MARIADB_ROOT_PASSWORD– MariaDB root password (required)SHLINK_DB_NAME– database name (default:shlink)SHLINK_DB_USER– database user (default:shlink)SHLINK_DB_PASSWORD– database password (required)
Shlink
SHLINK_DOMAIN– default short domain (default:localhost)SHLINK_HTTPS– whether HTTPS is enabled (default:false)SHLINK_REDIRECT_URL– base URL redirect for unknown short codes (default:https://localhost)TZ– timezone (default:America/Vancouver)
Volume Notes
${VOL_PATH:-/data}/shlink/db– MariaDB data files${VOL_PATH:-/data}/shlink/web-client– web client static config (servers.json)
Network Notes
Requires the external proxy network for reverse proxy access.
Docker Run
docker run -d \
--name shlink-mariadb \
-e MARIADB_DATABASE=shlink \
-e MARIADB_USER=shlink \
-e MARIADB_PASSWORD=ChangeThisPassword \
-e MARIADB_ROOT_PASSWORD=ChangeThisRootPassword \
-v /data/shlink/db:/var/lib/mysql \
mariadb:10.11
docker run -d \
--name shlink \
-p 8080:8080 \
-e DEFAULT_DOMAIN=localhost \
-e IS_HTTPS_ENABLED=false \
-e DB_DRIVER=maria \
-e DB_HOST=mariadb \
-e DB_NAME=shlink \
-e DB_USER=shlink \
-e DB_PASSWORD=ChangeThisPassword \
-e DEFAULT_BASE_URL_REDIRECT=https://localhost \
shlinkio/shlink:latest
docker run -d \
--name shlink-web-client \
-p 8003:80 \
-v /data/shlink/web-client:/usr/share/nginx/html \
shlinkio/shlink-web-client:latest
Additional Notes / Gotchas
- The web client does not have built-in user authentication. Use Nginx Proxy Manager (or similar) to add basic auth or IP restrictions in front of it.
- Generate an API key after starting:
docker compose exec shlink shlink api-key:generate - Use the API key to configure the web client under "Settings > Manage Servers".
- After changing
SHLINK_DOMAIN, you must update the domain in Shlink's config or via the API.
Dockhand Stack, Deploy from Git
Cookbooks Repository stackname: shlink Compose file path: shlink_dev/compose.yaml Additional env file (optional): shlink_dev/sample.env
Then "Load" shlink_dev/sample.env into the Environmental variables in dockhand
Create the Stack