Files
dropshell-templates/shlink
j dc4d42ed31
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 12s
add shlink
2026-01-14 16:01:05 +13:00
..
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00
2026-01-14 16:01:05 +13:00

Shlink - URL Shortener
======================

Shlink is a self-hosted URL shortener that allows you to create and manage
short URLs with tracking and analytics.

Website: https://shlink.io/

Configuration
-------------

Required settings in service.env:

  DEFAULT_DOMAIN    - The domain for your short URLs (e.g., s.example.com)
  IS_HTTPS_ENABLED  - Set to "true" if using HTTPS (recommended)
  DB_PASSWORD       - MariaDB user password (change from default!)
  DB_ROOT_PASSWORD  - MariaDB root password (change from default!)

Optional settings:

  GEOLITE_LICENSE_KEY - For IP geolocation features
                        Get a free key at: https://www.maxmind.com/en/geolite2/signup

  INITIAL_API_KEY     - Pre-set an API key on first install
                        If not set, generate one after install (see below)

Ports
-----

  HTTP_PORT (default: 8080) - Shlink API and redirect endpoint

Setup
-----

1. Configure your service.env with your domain and secure passwords

2. Install the service:
   dropshell install <server> shlink

3. Generate an API key (if INITIAL_API_KEY not set):
   docker exec -it shlink shlink api-key:generate

4. Point your short domain (e.g., s.example.com) to your server

5. Optionally put behind a reverse proxy (Caddy, nginx) for HTTPS

Usage
-----

Create a short URL via API:
  curl -X POST https://s.example.com/rest/v3/short-urls \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"longUrl": "https://example.com/very/long/url"}'

Or use the Shlink web client:
  https://app.shlink.io/

CLI commands (run inside container):
  docker exec -it shlink shlink short-url:create https://example.com
  docker exec -it shlink shlink short-url:list
  docker exec -it shlink shlink api-key:list

Database
--------

This template uses MariaDB for data persistence. The database is automatically
backed up and restored with the dropshell backup/restore commands.

Data is stored in: ${DATA_PATH}/mariadb

More Information
----------------

Documentation: https://shlink.io/documentation/
API Reference: https://shlink.io/documentation/api-docs/