Skip to content

Deploying Baby Buddy

Baby Buddy is a free, open-source application designed to help caregivers track and manage all aspects of infant care. Built with Django and Python, Baby Buddy provides a comprehensive dashboard for logging feedings, diaper changes, sleep patterns, tummy time, and growth measurements—helping parents and caregivers identify patterns and predict their baby’s needs without relying on guesswork.

With over 2,600 GitHub stars and an active community, Baby Buddy offers mobile apps for Android and iOS, Home Assistant integration, and support for 20+ languages, making it an ideal solution for families worldwide.

Track Everything

Log feedings, diapers, sleep, tummy time, and measurements

Insightful Reports

Visualize patterns with charts and statistics

Mobile Ready

Native Android app and responsive web design

Multi-Language

Support for 20+ languages worldwide

Key Features

Baby Buddy provides comprehensive baby tracking capabilities:

FeatureDescription
Feeding TrackingLog breast, bottle, and solid feedings with duration and amount
Diaper ChangesRecord wet, solid, and mixed diapers
Sleep LoggingTrack naps and nighttime sleep patterns
Tummy TimeMonitor tummy time sessions for development
Growth MeasurementsRecord weight, height, head circumference, and BMI
Temperature LoggingTrack temperature readings
TimersBuilt-in timers for activities
Notes & TagsAdd notes and organize with tags
Reports & StatisticsVisualize data with charts and trends
Multi-Child SupportTrack multiple children in one instance
REST APIFull API access for integrations

Prerequisites

Before deploying Baby Buddy on Klutch.sh, ensure you have:

  • A Klutch.sh account with an active project
  • A GitHub repository for your deployment
  • Optional: A PostgreSQL database for production deployments (see PostgreSQL guide)

Project Structure

Set up your Baby Buddy deployment repository:

  • Directorybabybuddy/
    • Dockerfile
    • docker-compose.yml (local development only)
    • .env.example
    • README.md

Deployment Configuration

Dockerfile

Baby Buddy uses the LinuxServer.io Docker image, which provides a well-maintained, multi-architecture container. Create a Dockerfile in your repository:

Dockerfile
FROM lscr.io/linuxserver/babybuddy:latest
# LinuxServer.io image exposes port 8000 by default
# Configuration is handled via environment variables
# Persistent data is stored in /config
VOLUME /config
EXPOSE 8000

Alternative: Build from Official Repository

If you prefer to build from the official Baby Buddy source:

Dockerfile
FROM python:3.12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
libjpeg-dev \
zlib1g-dev \
libopenjp2-7-dev \
&& rm -rf /var/lib/apt/lists/*
# Create app user
RUN useradd -m -s /bin/bash babybuddy
WORKDIR /app
# Clone and install Baby Buddy
RUN apt-get update && apt-get install -y git && \
git clone --depth 1 --branch master https://github.com/babybuddy/babybuddy.git . && \
pip install --no-cache-dir pipenv && \
pipenv install --system --deploy && \
apt-get remove -y git && apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# Create data directory
RUN mkdir -p /app/data/media && chown -R babybuddy:babybuddy /app
# Set environment defaults
ENV DJANGO_SETTINGS_MODULE=babybuddy.settings.production
ENV ALLOWED_HOSTS=*
USER babybuddy
EXPOSE 8000
# Run with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "babybuddy.wsgi:application"]

Environment Variables

Baby Buddy is configured through environment variables. Here are the key settings:

Required Variables

VariableDescriptionExample
SECRET_KEYDjango secret key (random, unique string)your-random-secret-key-here
ALLOWED_HOSTSAllowed hostnamesexample-app.klutch.sh
CSRF_TRUSTED_ORIGINSTrusted origins for CSRF protectionhttps://example-app.klutch.sh
TZTimezoneAmerica/New_York

LinuxServer.io Image Variables

VariableDescriptionDefault
PUIDUser ID for file permissions1000
PGIDGroup ID for file permissions1000
TZContainer timezoneEtc/UTC
CSRF_TRUSTED_ORIGINSComma-separated trusted originsRequired

Database Configuration

Baby Buddy uses SQLite by default, but PostgreSQL is recommended for production:

VariableDescriptionDefault
DB_ENGINEDatabase backenddjango.db.backends.sqlite3
DB_HOSTDatabase host-
DB_NAMEDatabase namedata/db.sqlite3
DB_USERDatabase username-
DB_PASSWORDDatabase password-
DB_PORTDatabase port5432
DATABASE_URLFull connection string (alternative)-

Security Configuration

VariableDescriptionDefault
SECRET_KEYDjango secret keyRequired
DEBUGEnable debug modeFalse
SECURE_PROXY_SSL_HEADERTrust X-Forwarded-Proto headerNone
CSRF_COOKIE_SECURESecure CSRF cookieFalse
SESSION_COOKIE_SECURESecure session cookieFalse

Application Configuration

VariableDescriptionDefault
ALLOW_UPLOADSAllow child photo uploadsTrue
SUB_PATHSubdirectory path if hosted in subfolder-

Storage Configuration (Optional S3)

VariableDescription
AWS_ACCESS_KEY_IDAWS S3 access key
AWS_SECRET_ACCESS_KEYAWS S3 secret key
AWS_STORAGE_BUCKET_NAMES3 bucket name
AWS_S3_ENDPOINT_URLCustom S3-compatible endpoint

Local Development with Docker Compose

Test your Baby Buddy setup locally:

docker-compose.yml
services:
babybuddy:
image: lscr.io/linuxserver/babybuddy:latest
container_name: babybuddy
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- CSRF_TRUSTED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
volumes:
- babybuddy_config:/config
ports:
- "8000:8000"
restart: unless-stopped
volumes:
babybuddy_config:

Production Setup with PostgreSQL

For production deployments, use PostgreSQL:

docker-compose.yml
services:
babybuddy:
image: lscr.io/linuxserver/babybuddy:latest
container_name: babybuddy
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- CSRF_TRUSTED_ORIGINS=http://localhost:8000
- DB_ENGINE=django.db.backends.postgresql
- DB_HOST=postgres
- DB_NAME=babybuddy
- DB_USER=babybuddy
- DB_PASSWORD=your-secure-password
- DB_PORT=5432
- SECRET_KEY=your-random-secret-key
volumes:
- babybuddy_config:/config
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
postgres:
image: postgres:16-alpine
container_name: babybuddy-db
environment:
POSTGRES_DB: babybuddy
POSTGRES_USER: babybuddy
POSTGRES_PASSWORD: your-secure-password
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U babybuddy -d babybuddy"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
babybuddy_config:
postgres_data:

Deploying to Klutch.sh

Option 1: SQLite (Simple Setup)

For personal use with a single family, SQLite provides a simple deployment:

  1. Push your repository to GitHub

    1. Create a new GitHub repository
    2. Add the Dockerfile to your repository
    Terminal window
    git init
    git add .
    git commit -m "Initial Baby Buddy configuration"
    git remote add origin https://github.com/yourusername/babybuddy.git
    git push -u origin main
  2. Create a new app on Klutch.sh

    1. Navigate to your Klutch.sh dashboard at klutch.sh/app
    2. Select your project or create a new one
    3. Click Create App and connect your GitHub repository
    4. Klutch.sh will automatically detect your Dockerfile
  3. Configure environment variables

    1. In your app settings, add the required environment variables
    VariableValue
    TZAmerica/New_York (your timezone)
    PUID1000
    PGID1000
    SECRET_KEYGenerate a random 50+ character string
    ALLOWED_HOSTSyour-app.klutch.sh
    CSRF_TRUSTED_ORIGINShttps://your-app.klutch.sh
    SECURE_PROXY_SSL_HEADERTrue
  4. Configure the internal port

    1. Set the internal port to 8000
    2. Select HTTP as the traffic type
  5. Set up persistent storage

    1. Add a persistent volume for Baby Buddy data
    Mount PathSize
    /config5 GB
  6. Deploy your application

    1. Click Deploy to build and launch Baby Buddy
    2. Monitor the build logs for any issues
    3. Once deployed, your app will be available at https://your-app.klutch.sh

Option 2: PostgreSQL (Production Setup)

For production deployments or multi-user setups:

  1. Deploy PostgreSQL database

    1. First, deploy a PostgreSQL database on Klutch.sh
    2. See our PostgreSQL deployment guide for detailed instructions
    3. Create a database named babybuddy
  2. Push your Baby Buddy repository to GitHub

    1. Create a new repository with the Dockerfile
    Terminal window
    git init
    git add .
    git commit -m "Initial Baby Buddy configuration"
    git remote add origin https://github.com/yourusername/babybuddy.git
    git push -u origin main
  3. Create a new app on Klutch.sh

    1. Navigate to your Klutch.sh dashboard at klutch.sh/app
    2. Select your project
    3. Click Create App and connect your GitHub repository
    4. Klutch.sh will automatically detect your Dockerfile
  4. Configure environment variables

    1. In your app settings, add the required environment variables
    VariableValue
    TZAmerica/New_York
    PUID1000
    PGID1000
    SECRET_KEYGenerate a random 50+ character string
    ALLOWED_HOSTSyour-app.klutch.sh
    CSRF_TRUSTED_ORIGINShttps://your-app.klutch.sh
    SECURE_PROXY_SSL_HEADERTrue
    DB_ENGINEdjango.db.backends.postgresql
    DB_HOSTYour PostgreSQL hostname
    DB_NAMEbabybuddy
    DB_USERbabybuddy
    DB_PASSWORDYour database password
    DB_PORT5432
  5. Configure the internal port

    1. Set the internal port to 8000
    2. Select HTTP as the traffic type
  6. Set up persistent storage

    1. Add a persistent volume for configuration and media files
    Mount PathSize
    /config5 GB
  7. Deploy your application

    1. Click Deploy to build and launch Baby Buddy
    2. Monitor the build logs for any issues
    3. Once deployed, your app will be available at https://your-app.klutch.sh

Initial Setup

After deployment, configure your Baby Buddy instance:

  1. Access Baby Buddy

    1. Navigate to https://your-app.klutch.sh
    2. Log in with default credentials: admin / admin
  2. Change admin password

    1. Click on admin in the top right corner
    2. Select Settings
    3. Navigate to password change
    4. Set a strong, unique password
  3. Add your first child

    1. Click Children in the menu
    2. Click Add Child
    3. Enter your child’s name, birth date, and optional photo
    4. Click Submit
  4. Configure user settings

    1. Go to SettingsUser Settings
    2. Set your preferred language
    3. Configure date/time format preferences
    4. Set your preferred units (metric/imperial)

Tracking Activities

Baby Buddy provides intuitive tracking for all baby activities:

Feedings

  1. Log a feeding

    1. Click ActivitiesFeedingsAdd Feeding
    2. Select the child and feeding type (breast, bottle, solid)
    3. Enter start time, duration, and amount
    4. Add optional notes

Diaper Changes

  1. Log a diaper change

    1. Click ActivitiesDiaper ChangesAdd Change
    2. Select the child
    3. Choose the type (wet, solid, or mixed)
    4. Optionally select color

Sleep

  1. Log sleep

    1. Click ActivitiesSleepAdd Sleep
    2. Enter start and end times
    3. Add optional notes about sleep quality

Using Timers

Timers make it easy to track activities in real-time:

  1. Start a timer

    1. Click TimersQuick Start Timer
    2. The timer begins immediately
  2. End and record

    1. When the activity ends, click the timer
    2. Select what to record (feeding, sleep, tummy time)
    3. Add any additional details

Managing Users

Add family members or caregivers:

  1. Create additional users

    1. Log in as admin
    2. Navigate to UsersAdd User
    3. Enter username and password
    4. Set appropriate permissions
  2. User permissions

    1. Staff status: Access to admin interface
    2. Superuser status: Full admin privileges
    3. Standard users can log activities without admin access

API Integration

Baby Buddy provides a comprehensive REST API:

Generate API Key

  1. Create an API key

    1. Navigate to your user settings
    2. Generate or view your API key

Example API Usage

Terminal window
# Get all children
curl -X GET "https://your-app.klutch.sh/api/children/" \
-H "Authorization: Token YOUR_API_KEY"
# Add a feeding
curl -X POST "https://your-app.klutch.sh/api/feedings/" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"child": 1,
"type": "breast milk",
"method": "bottle",
"amount": 120,
"start": "2024-01-15T14:30:00"
}'
# Log a diaper change
curl -X POST "https://your-app.klutch.sh/api/changes/" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"child": 1,
"wet": true,
"solid": false
}'

See the Baby Buddy API Documentation for complete API reference.

Mobile Access

Baby Buddy offers several mobile options:

Native Android App

The Baby Buddy for Android app provides:

  • Home screen widgets for quick logging
  • Timer support
  • Offline capability with sync

Progressive Web App

Baby Buddy’s responsive design works well on mobile browsers:

  1. Add to home screen

    1. Open Baby Buddy in your mobile browser
    2. Use browser menu to “Add to Home Screen”
    3. Access like a native app

Home Assistant Integration

Baby Buddy integrates with Home Assistant for smart home automation:

  1. Install the integration

    1. Add the Baby Buddy integration to Home Assistant
    2. Configure with your Baby Buddy URL and API key
  2. Available entities

    1. Last feeding time and method
    2. Last diaper change
    3. Last sleep duration
    4. Timer states

Backup and Recovery

Database Backup

For SQLite deployments:

Terminal window
# SQLite is stored in the /config volume
# Regular volume backups will capture the database

For PostgreSQL deployments:

Terminal window
pg_dump -U babybuddy -d babybuddy > babybuddy_backup.sql

Import/Export Data

Baby Buddy supports data import/export:

  1. Export data

    1. Navigate to AdminImport/Export
    2. Select data types to export
    3. Download JSON or CSV format
  2. Import data

    1. Navigate to AdminImport/Export
    2. Upload your backup file
    3. Confirm the import

Troubleshooting

Common issues and solutions:

IssueCauseSolution
CSRF verification failedMissing or wrong CSRF_TRUSTED_ORIGINSAdd your full URL with https:// prefix
502 Bad GatewayWrong internal portEnsure internal port is set to 8000
Database errorsPostgreSQL connection issuesVerify database credentials and connectivity
Static files not loadingVolume permissionsCheck PUID/PGID match volume ownership
Can’t upload imagesALLOW_UPLOADS disabledSet ALLOW_UPLOADS=True

Checking Logs

Monitor logs through the Klutch.sh dashboard:

  1. View application logs

    1. Navigate to your app in the Klutch.sh dashboard
    2. Check deployment and runtime logs
    3. Look for Django error messages

Additional Resources