8000 GitHub - d1ceward-on-dokku/shlink_on_dokku: Dockerfile to run Shlink (URL shortener) on Dokku (mini-Heroku)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

d1ceward-on-dokku/shlink_on_dokku

Shlink Dokku Maintenance

Run Shlink on Dokku

Overview

This guide explains how to deploy Shlink, a self-hosted URL shortener, on a Dokku host. Dokku is a lightweight PaaS that simplifies deploying and managing applications using Docker.

Prerequisites

Before proceeding, ensure you have the following:

Setup Instructions

1. Create the App

Log into your Dokku host and create the shlink app:

dokku apps:create shlink

2. Configure the App

Install, Create, and Link PostgreSQL Plugin

  1. Install the PostgreSQL plugin:

    dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
  2. Create a PostgreSQL service:

    dokku postgres:create shlink
  3. Link the PostgreSQL service to the app:

    dokku postgres:link shlink shlink

Set the Default Domain

Set the default domain for your Shlink instance:

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

3. Configure the Domain and Ports

Set the domain for your app to enable routing:

dokku domains:set shlink shlink.example.com

Map the internal port 8080 to the external port 80:

dokku ports:set shlink http:80:8080

4. Deploy the App

You can deploy the app to your Dokku server using one of the following methods:

Option 1: Deploy Using dokku git:sync

If your repository is hosted on a remote Git server with an HTTPS URL, you can deploy the app directly to your Dokku server using dokku git:sync. This method also triggers a build process automatically. Run the following command:

dokku git:sync --build shlink https://github.com/d1ceward-on-dokku/shlink_on_dokku.git

This will fetch the code from the specified repository, build the app, and deploy it to your Dokku server.

Option 2: Clone the Repository and Push Manually

If you prefer to work with the repository locally, you can clone it to your machine and push it to your Dokku server manually:

  1. Clone the repository:

    # Via HTTPS
    git clone https://github.com/d1ceward-on-dokku/shlink_on_dokku.git
  2. Add your Dokku server as a Git remote:

    git remote add dokku dokku@example.com:shlink
  3. Push the app to your Dokku server:

    git push dokku master

Choose the method that best suits your workflow.

5. Enable SSL (Optional)

Secure your app with an SSL certificate from Let's Encrypt:

  1. Add the HTTPS port:

    dokku ports:add shlink https:443:8080
  2. Install the Let's Encrypt plugin:

    dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
  3. Set the contact email for Let's Encrypt:

    dokku letsencrypt:set shlink email you@example.com
  4. Enable Let's Encrypt for the app:

    dokku letsencrypt:enable shlink

Wrapping Up

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

For more information about Shlink, visit the official documentation.

About

Dockerfile to run Shlink (URL shortener) on Dokku (mini-Heroku)

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

0