---
title: "Deploy SparkyFitness on Pethost in one click"
description: "Track food, exercise, water and body measurements, a MyFitnessPal alternative. A template for Pethost: in a minute or two the app is live on your machine, with HTTPS at its own address and nightly backups."
---

[← All templates](https://pethost.dev/templates/)

# Deploy SparkyFitness on Pethost in one click

Track food, exercise, water and body measurements, a MyFitnessPal alternative

[Deploy on Pethost](https://console.pethost.dev/?template=sparkyfitness)

## What happens

1. You sign in to Pethost or make an account, with a passkey, GitHub or Google.
2. No machine yet? You pick a plan, and we prepare one for you. The link waits in your browser until it is ready.
3. New project opens at the app, and you click Create project.
4. In a minute or two the app is live at its own address with HTTPS. Its secrets are made for it at random, and its data is in the nightly backup.
5. It is a project like any other: its compose.yaml, its .env, its logs and a terminal are in the panel, and your agent can change it, roll it back or restore it.

## First steps

Open the address and sign up: the first account is the admin. Then add DISABLE_SIGNUP=true to the project’s .env and deploy again, so that nobody else can sign up.

## What it runs

The template is this compose.yaml and the variables it writes into the project’s .env. Pethost runs the file as it is written.

```
services:
  # The web app; its nginx sends /api and /uploads to the server.
  sparkyfitness-frontend:
    image: codewithcj/sparkyfitness:v1.8.0
    restart: unless-stopped
    environment:
      SPARKY_FITNESS_FRONTEND_URL: ${URL}
      SPARKY_FITNESS_SERVER_HOST: sparkyfitness-server
      SPARKY_FITNESS_SERVER_PORT: 3010
    depends_on:
      - sparkyfitness-server

  sparkyfitness-server:
    image: codewithcj/sparkyfitness_server:v1.8.0
    restart: unless-stopped
    environment:
      SPARKY_FITNESS_DB_HOST: sparkyfitness-db
      SPARKY_FITNESS_DB_PORT: 5432
      SPARKY_FITNESS_DB_NAME: sparkyfitness_db
      SPARKY_FITNESS_DB_USER: sparky
      SPARKY_FITNESS_DB_PASSWORD: ${DB_PASSWORD}
      SPARKY_FITNESS_APP_DB_USER: sparky_app
      SPARKY_FITNESS_APP_DB_PASSWORD: ${APP_DB_PASSWORD}
      # Better Auth's address, trusted origins and secure cookies.
      SPARKY_FITNESS_FRONTEND_URL: ${URL}
      SPARKY_FITNESS_API_ENCRYPTION_KEY: ${ENCRYPTION_KEY}
      BETTER_AUTH_SECRET: ${AUTH_SECRET}
      NODE_ENV: production
      SPARKY_FITNESS_LOG_LEVEL: ERROR
      SPARKY_FITNESS_SERVER_PORT: 3010
      # The project's proxy and the web app's nginx.
      SPARKY_FITNESS_TRUSTED_PROXY_HOPS: 2
      # Open until the first account is made; the notes say how to close it.
      SPARKY_FITNESS_DISABLE_SIGNUP: ${DISABLE_SIGNUP:-false}
    volumes:
      - backup:/app/SparkyFitnessServer/backup
      - uploads:/app/SparkyFitnessServer/uploads
    depends_on:
      sparkyfitness-db:
        condition: service_healthy

  sparkyfitness-db:
    image: postgres:18.3-alpine
    restart: unless-stopped
    environment:
      POSTGRES_DB: sparkyfitness_db
      POSTGRES_USER: sparky
      POSTGRES_PASSWORD: ${DB_PASSWORD}
    volumes:
      - db:/var/lib/postgresql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U sparky -d sparkyfitness_db"]
      interval: 5s
      timeout: 5s
      retries: 20

volumes:
  backup:
  uploads:
  db:
```

[compose.yaml](https://pethost.dev/templates/sparkyfitness/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/sparkyfitness)

Pethost · Stephan Gomer · NIP 1133096755

[Templates](https://pethost.dev/templates/) [About](https://pethost.dev/about/) [Blog](https://pethost.dev/blog/) [Terms](https://pethost.dev/terms/) [Privacy](https://pethost.dev/privacy/) [Refunds](https://pethost.dev/refunds/) [API](https://pethost.dev/docs/api/) [CLI](https://pethost.dev/docs/cli/) [Plugin](https://github.com/pethost-dev/plugin) [support@pethost.dev](mailto:support@pethost.dev)
