Menu

How To: Install Peloton to Garmin on Portainer

One of the biggest complaints I have for Peloton is that lack of integration with Garmin, as I like to see all my fitness data in one place. Having everything syncing makes things like tracking calories and macros easier in apps like MyFitnessPall. For years now, I have been leveraging an application called Peloton to Garmin to sync the data between the two platforms, but having it live on my NAS so I can run it from any computer in the house was good enough for a while, until they released a version for Docker. That changed everything.

Unfortunately, setting it up wasn’t as straight forward as I would have hoped. The compose file kept throwing errors in Portainer until I figured out that it was trying to create a directory instead of a file. Once that was sorted, everything was smooth sailing.

If you are interested in getting Peloton to Garmin running on Portainer, here is how I did it.

Open Putty or your preferred SSH client and connect to your server

Create a directory called p2g-webui in /home

cd /home
mkdir p2g-webui

Use nano or vi to create a file named webui.local.json

sudo nano webui.local.json

Paste the code below

{
  "Api": {
    "HostUrl": "http://p2g-api:8080"
  },
  "Observability": {
    "Prometheus": {
      "Enabled": false
    },
    "Jaeger": {
      "Enabled": false,
      "AgentHost": "localhost",
      "AgentPort": 6831
    },
    "Serilog": {
      "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
      "MinimumLevel": {
        "Default": "Information",
        "Override": {
          "Microsoft": "Error",
          "System": "Error"
        }
      },
      "WriteTo": [
        { "Name": "Console" }
      ]
    }
  }
}

Use nano or vi to create a file named api.local.json

sudo nano api.local.json

Paste the code below

{
  "Observability": {
    "Prometheus": {
      "Enabled": false
    },
    "Jaeger": {
      "Enabled": false,
      "AgentHost": "localhost",
      "AgentPort": 6831
    },
    "Serilog": {
      "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
      "MinimumLevel": {
        "Default": "Information",
        "Override": {
          "Microsoft": "Error",
          "System": "Error"
        }
      },
      "WriteTo": [
        { "Name": "Console" }
      ]
    }
  }
}

Create a new Stack in Portainer named p2gwebui

Paste the following

services:
  p2g-api:
    container_name: p2g-api
    image: philosowaffle/peloton-to-garmin:api-stable
    environment:
      - TZ=America/New_York
    # ports:
    #   - 8001:8080 # optional, only if you plan to interact with the API directly
    volumes:
      - /home/p2g-webu/api.local.json:/app/configuration.local.json
      - /home/p2g-webu/data:/app/data # recommended for saving settings across restarts
      - /home/p2g-webu/output:/app/output # optional, if you want access to the generated workout and log files
  
  p2g-webui:
    container_name: p2g-webui
    image: philosowaffle/peloton-to-garmin:webui-stable
    ports:
      - 8002:8080
    environment:
      - TZ=America/New_York
    volumes:
      - /home/p2g-webu/webui.local.json:/app/configuration.local.json
    depends_on:
      - p2g-api

Click Deploy the Stack, configure from the webui at port 8002 and enjoy!

About Joe DiFiglia

Fitness and sport enthusiast. Spartan Race Junky. I have been a martial artist since the age of 4 and addicted to anything challenging. Years of Martial Arts training provides the ability to keep going when my body really wants to quit.

Check Also

Deconstructing OCR Training Part 2: The Obstacles

In Part 1 of this article I deconstructed obstacle course races (OCR) into two key components: running and obstacles. Part 1 focused exclusively on the running component of OCR races. Now, it’s time to focus on the obstacles.