Shlink

Shlink

An easy to use, open-source, link shortener web app and API

Deploy Shlink

Shlink Web Client

MykalMachon/shlink-on-railway

Just deployed

Shlink

shlinkio/shlink:stable

Just deployed

Postgres

railwayapp-templates/postgres-ssl:latest

Just deployed

/var/lib/postgresql/data

What is this template?

Shlink is a self-hosted URL shortener that enables you to create, and track the usage of "short" URLs that redirect to other, longer, URLs. Shlink also provides analytics on URL usage, such as visit counts and geographic location of the visitors.

This template spins up:

  • Shlink the official shlink application. This handles short links and serves an authenticated API for management.
  • Shlink Web Client the official Shlink web client used for managing and monitoring your short links + HTTP basic-authentication via NGINX.

This template makes deploying Shlink extremely easy; It can be setup in less than 5 minutes.

Quick start guide

  1. Click the "Deploy on Railway" button above
  2. Follow the setup steps on Railway
    1. Enter a username for the shlink web client.
    2. Enter a password for the shlink web client.
    3. Click "deploy!"
  3. Monitor your services as the come up; wait until everyting is up with a green checkmark.
  4. You're good to go!
    1. You can access the web client using your username and password.
    2. You can access shlink directly via the API using the API key generated by Railway.

Optional: configuring your own domains

You'll probably want your shlink service to have a custom domain so the generated shortlinks are shorter than the links you're redirecting to.

See this guide on Railway for configuring a custom domain.

Optional: configuring app sleeping

If you want your services to scale down when not in use, you can setup app sleeping on Railway.

See this guide on Railway for configuring app sleeping.

Project structure & services

This template is made up of three railway services:

  • Shlink: primary short link application
    • The primary short link application.
    • Serves a REST API that allows users to manage short links.
    • All your generated short links will be at this service's URL.
  • Shlink Web Client: web app for managing Shlink
    • Web UI for handling your short URLs, creating new ones or monitoring visit stats.
    • The Web UI hooks into the Shlink service's API on template generation and requires no extra setup.
    • This template bolts on HTTP basic-authentication to the web client making it safe to expose to the internet.
  • PostgreSQL Database: primary database used by Shlink

Additional resources

Feedback

If you have feedback on this template, please submit a GitHub issue with as much detail as possible.

Known issues

  • Shlink cannot connect to the database via private networking: this is due to the fact that shlink appears to not support IPV6 networking (which Railway uses for it's private networking features). If you can see a way around this, feel free to leave an explanation in the open issue or file a pull request.

Template Content

Deploy Now

Details

Mykal's Projects

Created on Mar 10, 2024

137 total projects

41 active projects

96% success on recent deploys

Dockerfile

Other



More templates in this category

View Template
Foundry Virtual Tabletop

Foundry Virtual Tabletop

A Self-Hosted & Modern Roleplaying Platform


Lucas's Projects

View Template
(v1) Simple Medusa Backend

(v1) Simple Medusa Backend

Deploy an ecommerce backend and admin using Medusa


Shahed Nasser's Projects

View Template
peppermint

peppermint

Docker-compose port for peppermint.sh


HamiltonAI