Skip to content

d1ceward/shlink_on_dokku

Shlink Dokku Maintenance

Run Shlink on Dokku

Perquisites

What is Shlink?

Shlink is a PHP-based self-hosted URL shortener that can be used to serve shortened URLs under your own domain.

What is Dokku?

Dokku is the smallest PaaS implementation you've ever seen - Docker powered mini-Heroku.

Requirements

Setup

Note: Throughout this guide, we will use the domain shlink.example.com for demonstration purposes. Make sure to replace it with your actual domain name.

Create the app

Log into your Dokku host and create the Shlink app:

dokku apps:create shlink

Configuration

Install, create and link PostgreSQL plugin

# Install postgres plugin on Dokku
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
# Create running plugin
dokku postgres:create shlink
# Link plugin to the main app
dokku postgres:link shlink shlink

Setting default domain

dokku config:set shlink DEFAULT_DOMAIN=shlink.example.com

Domain setup

To enable routing for the Shlink app, we need to configure the domain. Execute the following command:

dokku domains:set shlink shlink.example.com

Push Shlink to Dokku

Grabbing the repository

Begin by cloning this repository onto your local machine.

# Via SSH
git clone git@github.com:d1ceward/shlink_on_dokku.git

# Via HTTPS
git clone https://github.com/d1ceward/shlink_on_dokku.git

Set up git remote

Now, set up your Dokku server as a remote repository.

git remote add dokku dokku@example.com:shlink

Push Shlink

Now, you can push the Shlink app to Dokku. Ensure you have completed this step before moving on to the next section.

git push dokku master

SSL certificate

Lastly, let's obtain an SSL certificate from Let's Encrypt.

# Install letsencrypt plugin
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git

# Set certificate contact email
dokku letsencrypt:set shlink email you@example.com

# Generate certificate
dokku letsencrypt:enable shlink

Wrapping up

Congratulations! Your Shlink instance is now up and running, and you can access it at https://shlink.example.com.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks