Documentation
Guides
Customize runtipi compose and traefik config

Customize runtipi compose and traefik config

In this guide, we'll show you how to customize the default docker compose file of runtipi and the traefik config.

⚠️

This guide is for advanced users who are familiar with docker and traefik. If you break the config we won't be able to help you. You will probably face issues if the main runtipi config is changed.

Example use cases

  • Enable the traefik dashboard
  • Change the log level of traefik to DEBUG

Create a custom docker compose file

In this example we will expose the traefik dashboard by editing the main runtipi compose file.

Firstly we need to figure out what port traefik dashboard uses (which is 8080) and what is the name of the docker container of traefik (which we can learn from the docker-compose.yml) which is runtipi-reverse-proxy in this case.

💡

Don't edit the docker-compose.yml file directly because it will be overwritten on every restart of runtipi.

Create the custom docker compose file

Create the file tipi-compose.yml in the user-config directory within the runtipi folder:

nano user-config/tipi-compose.yml

Add your changes

For this example add the following contents:

services:
  runtipi-reverse-proxy:
    ports:
      - 8080:8080

Then save and exit.

Check your file structure

You should have this file structure:

      • tipi-compose.yml
  • Restart runtipi and test the changes

    ./runtipi-cli restart

    After restarting you should be able to see the traefik dashboard by visiting SERVER-IP:8080

    Edit the traefik config file

    In this example we will just change the log level of traefik to DEBUG, that is a very simple example to showcase the process.

    Firstly we need to figure out what we need to change, the default traefik config of runtipi is this:

    api:
      dashboard: true
      insecure: true
     
    providers:
      docker:
        endpoint: 'unix:///var/run/docker.sock'
        watch: true
        exposedByDefault: false
      file:
        directory: /root/.config/dynamic
        watch: true
     
    entryPoints:
      web:
        address: ':80'
      websecure:
        address: ':443'
        http:
          tls:
            certResolver: myresolver
     
    certificatesResolvers:
      myresolver:
        acme:
          email: acme@thisprops.com
          storage: /shared/acme.json
          httpChallenge:
            entryPoint: web
     
    log:
      level: ERROR

    We can see that the part we need to change is this:

    log:
      level: ERROR

    By default if you try to edit the traefik config it will be overwritten on every restart. To keep the config we need to change a setting which can be done easily by editing the settings.json file.

    Modify the the settings

    Open the runtipi/state/settings.json file with your prefered editor. Your settings file will look something like this:

    {
      "dnsIp": "9.9.9.9",
      "internalIp": "10.10.10.5",
      "postgresPort": 5432,
      "appsRepoUrl": "https://github.com/runtipi/runtipi-appstore",
      "domain": "example.com",
      "appDataPath": "/home/runtipi/runtipi/",
      "localDomain": "tipi.lan",
      "demoMode": false,
      "guestDashboard": false,
      "allowAutoThemes": true,
      "allowErrorMonitoring": true,
      "persistTraefikConfig": false
    }

    Here you need to change the "persistTraefikConfig" from false to true.

    Now runtipi will keep your custom traefik config on start, you can always change it back to true to reset your changes. So now that our config is persistent we can safely make our changes by opening the traefik/traefik.yml file and changing this:

    log:
      level: ERROR

    To this:

    log:
      level: DEBUG

    Test the changes

    Finally restart runtipi:

    sudo ./runtipi-cli restart

    Congratulations! Now your traefik container will run in debug mode so you can fix some problem for example.