How to run Linkstack Through Caddy with Docker

· 234 words · 2 minute read

Welcome everyone, in this post we’re going to see how to install Linkstack and run it behind HTTPS server Caddy.

What is Linkstack ? 🔗

As defined on their Landing Page, it is a Self-hosted open-source Linktree alternative, a highly customizable link sharing platform with an intuitive, easy to use user interface.

How to run Linkstack 🔗

Linkstack is build on PHP and Laravel (PHP framework) but the team at Linkstack gives us the opportunity to run their application using Docker.

Here’s the docker-compose.yml file:

version: '3'
services:
  linkstack:
    image: linkstackorg/linkstack:latest
    environment:
      - TZ=Europe/Berlin
      - [email protected]
      - HTTP_SERVER_NAME=app.kvrn.cc
      - HTTPS_SERVER_NAME=app.kvrn.cc 
      - LOG_LEVEL=info
      - PHP_MEMORY_LIMIT=512M
      - UPLOAD_MAX_FILESIZE=16M
    ports:
      - "8880:80"
      - "8443:443"
    volumes:
      - linkstack:/htdocs
    restart: unless-stopped
volumes:
  linkstack:

Of course you have to adapt

  • TZ to be your TimeZone
  • SERVER_ADMIN to be your email
  • HTTP_SERVER_NAME & HTTPS_SERVER_NAME to be your server address

You can keep the remaining parameter as is.

You can launch your linkstack instance with docker-compose up -d

How to run it through Caddy 🔗

Once we’ve got linkstack running on our machine, we’ll want it to be accessible to the internet and so we are going to use Caddy as a reverse-proxy for our instance.

You just have to add these lines to your /etc/caddy/Caddyfile file

app.kvrn.cc {
        reverse_proxy https://localhost:8443 {
                transport http {
                        tls
                        tls_insecure_skip_verify
                }
        }
}

That’s it! your app is now running on https://app.kvrn.cc or whatever your domain is :)