Deploy getHomepage with Traefik Labels and Use Under a DNS Entry
Lewin Grunenberg 3 Minuten Lesezeit

Deploy getHomepage with Traefik Labels and Use Under a DNS Entry

Learn how to deploy getHomepage using Docker Compose and Traefik, and access it via a DNS entry.
gethomepage dashboard traefik docker on-premise self-hosted

GetHomepage and Traefik - Easy Integration and DNS Configuration

In this post, we will show you how to deploy the dashboard app getHomepage using Docker Compose and Traefik, and access it through a DNS entry like https://my.your-domain.org. This configuration allows for easy and centralized management of your SaaS tools.

Introduction to Traefik

Traefik is a dynamic reverse proxy and load balancer designed specifically for modern applications. It enables automatic service discovery and easy management of SSL/TLS certificates. You can find more details in our Traefik Tutorial.

Introduction to getHomepage

getHomepage is an open-source dashboard app that allows you to centrally manage various web applications and links. It provides a clear interface to quickly access your most-used tools and sites. getHomepage is ideal for those who want to consolidate their online tools in one place and manage them more efficiently.

Setting the DNS Entry

Before proceeding with the setup, ensure that the DNS entry for my.your-domain.org is correctly set. This entry should point to the IP address of the server where Traefik is running. Use your DNS management service, such as Cloudflare, to add the appropriate entry.

Introduction to Docker and Docker Compose

Docker allows applications to run in isolated containers, significantly simplifying their deployment and scaling. Docker Compose is a tool for defining and running multi-container applications. It helps manage complex application environments with just a few commands.

Docker Compose Presentation for getHomepage

getHomepage

The getHomepage service provides the dashboard and is made accessible via Traefik:

services:
  homepage:
    image: ghcr.io/gethomepage/homepage:latest
    container_name: homepage
    ports:
      - "3030:3000"
    volumes:
      - /your/homepage/path:/app/config  # Replace '/your/homepage/path' with the actual path
      - /var/run/docker.sock:/var/run/docker.sock:ro  # Optional, for Docker integrations
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.homepage.rule=Host(`my.your-domain.org`)"  # Replace 'your-domain.org' with your actual domain
      - "traefik.http.routers.homepage.entrypoints=websecure"
      - "traefik.http.routers.homepage.tls.certresolver=lets-encrypt"
      - "traefik.http.services.homepage.loadbalancer.server.port=3000"
    networks:
      - web

Configuration Explanation

  • Volumes: The path /your/homepage/path must be adjusted to a specific directory on your host system where the configuration files for getHomepage can be stored and edited. This allows you to centrally store and modify your dashboard settings as needed.

Traefik

The Traefik labels are crucial for correctly configuring the service and routing traffic accordingly:

  • traefik.enable=true: Enables Traefik for this service, allowing Traefik to monitor and route requests to the service.
  • traefik.http.routers.homepage.rule=Host('my.your-domain.org'): Defines the URL mapping condition that routes requests to my.your-domain.org to the getHomepage service.
  • traefik.http.routers.homepage.entrypoints=websecure: Instructs Traefik to serve this service via the websecure entry point, used for HTTPS traffic.
  • traefik.http.routers.homepage.tls.certresolver=lets-encrypt: Specifies that Traefik uses Let’s Encrypt to secure HTTPS traffic.
  • traefik.http.services.homepage.loadbalancer.server.port=3000: Specifies the internal port of the getHomepage service to which Traefik routes traffic.

Networks

The network settings define the network Traefik uses to connect services:

networks:
  web:
    external: true  # Uses an external network managed by Traefik

This section defines the network used by Traefik to connect the various services and manage connections.

Conclusion

With this guide, you can efficiently and securely deploy getHomepage with Traefik and Docker. The configuration is flexible and can be easily adapted to individual requirements. For further questions or professional support, check out our Discord Channel. We are happy to assist you with the optimal setup and management of your applications.

Complete Docker Compose

Here is the complete docker-compose.yml file for the getHomepage installation:

version: "3.3"

services:
  homepage:
    image: ghcr.io/gethomepage/homepage:latest
    container_name: homepage
    ports:
      - "3030:3000"
    volumes:
      - /your/homepage/path:/app/config  # Replace '/your/homepage/path' with the actual path
      - /var/run/docker.sock:/var/run/docker.sock:ro  # Optional, for Docker integrations
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.homepage.rule=Host(`my.your-domain.org`)"  # Replace 'your-domain.org' with your actual domain
      - "traefik.http.routers.homepage.entrypoints=websecure"
      - "traefik.http.routers.homepage.tls.certresolver=lets-encrypt"
      - "traefik.http.services.homepage.loadbalancer.server.port=3000"
    networks:
      - web

networks:
  web:
    external: true  # Uses an external network managed by Traefik

Ähnliche Artikel