Dockge

repository·master·Indexed 11 days ago

https://github.com/louislam/dockge

A reactive, stack-oriented manager for Docker Compose files. Dockge provides a web interface to create, edit, and manage compose-based deployments while maintaining a file-based structure that allows direct interaction via the CLI. Version 1.5.0.

Tokens
3.2K
Snippets
15
Records
18
Agent score
98%

What's inside Dockge

  1. Install Dockge (Basic Setup)

    master

    To install Dockge using default settings (Stacks directory: /opt/stacks, Port: 5001), follow these steps:

    1. Create the necessary directories for your stacks and the Dockge configuration.
    2. Download the official compose.yaml.
    3. Start the server using Docker Compose.

    Note: If you are using Podman, ensure podman-docker is installed. If using Docker Compose V1, use docker-compose up -d instead of docker compose up -d.

    # Create directories that store your stacks and stores Dockge's stack
    mkdir -p /opt/stacks /opt/dockge
    cd /opt/dockge
    
    # Download the compose.yaml
    curl https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml --output compose.yaml
    
    # Start the server
    docker compose up -d
  2. Import existing Docker Compose stacks into Dockge

    master

    If you have existing stacks that you want to manage via Dockge, follow these steps:

    1. Stop the existing stack.
    2. Move the stack's compose.yaml file into the Dockge stacks directory using the format: /opt/stacks/<stackName>/compose.yaml.
    3. In the Dockge Web UI, click the "Scan Stacks Folder" button located in the top-right corner's dropdown menu.
    4. The stack will now appear in your Dockge list.
  3. How to add a new language to the Dockge dropdown

    master

    If you want to add a new language to the Dockge UI selection dropdown, follow these steps:

    1. Request/Add your language at https://weblate.kuma.pet/projects/dockge/dockge/.
    2. Identify your language code (this is the string found at the end of the Weblate URL).
    3. Open frontend/src/i18n.ts and append your language to the languageList object using the format: "CODE": "Language Name".
    4. Commit your changes to a new branch and submit a Pull Request.
    // Example format for frontend/src/i18n.ts
    "zh-TW": "繁體中文 (台灣)"
  4. Install Dockge (Advanced Setup)

    master

    For custom configurations, you can either use the interactive generator at https://dockge.kuma.pet or manually configure your compose.yaml.

    Customizing via URL

    You can generate a custom compose.yaml by appending query strings to https://dockge.kuma.pet/compose.yaml:

    • port: The port you want to use (e.g., 5001).
    • stacksPath: The host path where your stacks will be stored (e.g., /opt/stacks).

    Manual Configuration Requirements

    When manually writing your compose.yaml, ensure the following:

    1. Volume Mapping: The host path for stacks must match the container path exactly. For example, if your stacks are at /opt/stacks on the host, map them as - /opt/stacks:/opt/stacks.
    2. Environment Variables:
      • DOCKGE_STACKS_DIR: Must point to the path inside the container where stacks are located.
      • PUID and PGID: Must be set in the environment: section to manage file ownership. Without these, Dockge defaults to root.
    services:
      dockge:
        image: louislam/dockge:1
        restart: unless-stopped
        ports:
          - 5001:5001
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - ./data:/app/data
          # Stacks Directory: Host and Container paths MUST match
          - /opt/stacks:/opt/stacks
        environment:
          - DOCKGE_STACKS_DIR=/opt/stacks
          - PUID=1000
          - PGID=1000
  5. Deploy Dockge using Docker Compose

    master

    To run Dockge, use the following compose.yaml configuration. This setup requires mounting the Docker socket to allow Dockge to manage containers, a directory for Dockge's internal data, and a dedicated directory for your stacks.

    Critical Requirements for Stacks Directory:

    1. Use a FULL path only. Relative paths are not supported.
    2. The host path (left side) must match the container path (right side) in the volumes section.
    3. The DOCKGE_STACKS_DIR environment variable must point to this same path.
    services:
      dockge:
        image: louislam/dockge:1
        restart: unless-stopped
        ports:
          - 5001:5001
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - ./data:/app/data
          - /opt/stacks:/opt/stacks
        environment:
          - DOCKGE_STACKS_DIR=/opt/stacks
  6. Configure Uptime Kuma stack via compose.yaml

    master

    This template defines a Docker Compose configuration for deploying Uptime Kuma. It uses the louislam/uptime-kuma:1 image and maps local storage to the container for persistence.

    Key configuration details:

    • Image: louislam/uptime-kuma:1
    • Persistence: The ./data directory on the host is mounted to /app/data inside the container.
    • Network: Port 3001 is exposed and mapped to the host's port 3001.
    • Restart Policy: Set to always to ensure the service restarts automatically.
    services:
      uptime-kuma:
        image: louislam/uptime-kuma:1
        volumes:
          - ./data:/app/data
        ports:
          - "3001:3001"
        restart: always
  7. Configure Dockge volumes and environment variables

    master

    When configuring the dockge service in compose.yaml, use the following settings:

    Volumes

    • /var/run/docker.sock:/var/run/docker.sock: Required to allow Dockge to communicate with the Docker daemon.
    • ./data:/app/data: Stores Dockge's internal application data.
    • /opt/stacks:/opt/stacks: The directory where your Docker Compose stacks are stored. Must be an absolute path and must match the DOCKGE_STACKS_DIR value.
    • /root/.docker/:/root/.docker (Optional): Mount this if you need to use private Docker registries by sharing your auth configuration.

    Environment Variables

    • DOCKGE_STACKS_DIR: The absolute path to the directory where Dockge manages your stacks (e.g., /opt/stacks).
  8. Deploy Nginx Proxy Manager via Dockge template

    master

    This template allows you to deploy nginx-proxy-manager using Docker Compose. It exposes standard HTTP, HTTPS, and management ports, and uses local directories for persistent data and SSL certificates.

    Port Mapping:

    • 80: HTTP traffic
    • 81: Nginx Proxy Manager Admin Interface
    • 443: HTTPS traffic

    Persistence:

    • ./data: Stores application data.
    • ./letsencrypt: Stores Let's Encrypt SSL certificates.
    services:
      nginx-proxy-manager:
        image: 'jc21/nginx-proxy-manager:latest'
        restart: unless-stopped
        ports:
          - '80:80'
          - '81:81'
          - '443:443'
        volumes:
          - ./data:/data
          - ./letsencrypt:/etc/letsencrypt
  9. Use the MariaDB template for Dockge stacks

    master

    This compose.yaml file serves as a template for deploying a MariaDB service within a Dockge stack. It uses the official MariaDB image and exposes the standard database port. When using this template, ensure you update the MARIADB_ROOT_PASSWORD to a secure value.

    services:
      mariadb:
        image: mariadb:latest
        restart: unless-stopped
        ports:
          - 3306:3306
        environment:
          - MARIADB_ROOT_PASSWORD=123456