Skip to content
Pocket Homelab
Get the appComing soon to the App Store

Pocket Health

Send Apple Health from the iPhone to your own Pocket Health server: steps, energy and distance per hour, heart rate, sleep with its stages, workouts, weight, blood pressure and the other readings you allow, and see today's numbers.

iPhoneMac
On this page

Pocket Health is a free, open-source (MIT), self-hosted home for your health data: every metric your iPhone and watch record, goals with streaks, workouts, sleep, medications, symptoms, insights and a weekly recap. One Go binary, one SQLite file. It is made by the author of Pocket Homelab. The iPhone is where the data is, so Pocket Homelab is the way it gets there: it reads Apple Health and sends it to your server. Charts, goals, medications and insights stay in the web app.

Set up

  1. With Pocket Core: pair the device (Settings → Services → Pocket Core). Health is part of the profile; skip to step 3.
  2. Without Core: in Pocket Health open Settings → Phone & imports and tap Create token under iPhone: Pocket Homelab (or create one under API & shortcuts). Copy it: it starts with ph_ and is shown once. In Pocket Homelab: Settings → Services → Health, paste the address and the token, then Test connection. It answers with today’s steps, sleep and goals.
  3. Open the Health card on Home (or turn on the Health tab in Settings → Tabs), choose Start from (the last 30 days, 3 months, a year or everything) and tap Connect Apple Health. Allow what you want to share in Apple’s sheet.
Environment keys
KeyFieldRequiredSecretWhere to get it
HEALTH_URLPocket Health URLRequired—Base address of your Pocket Health server. The iPhone sends Apple Health there (steps, heart, sleep, workouts, weight and the rest) and shows today's numbers. Leave empty to hide it.
HEALTH_API_KEYPocket Health API tokenRequired—A token from Pocket Health → Settings → Phone & imports or API & shortcuts (starts with ph_). Stored in the Keychain.

What the iPhone sends

  • Steps, energy, distance, exercise and stand minutes, flights, water, caffeine and the rest of what adds up as one total per hour, as Apple Health counts it: the iPhone and the watch are counted once, not twice.
  • Heart rate, HRV, blood oxygen, respiratory rate, walking and running form, sound levels as an average per hour with that hour’s lowest and highest.
  • Weight, body fat, BMI, resting heart rate, VO₂ max, blood glucose, blood pressure and other occasional readings one by one, with the app or device that recorded them.
  • Workouts with distance, energy, heart rate and elevation; nights with time asleep, in bed, deep, core, REM and awake. When several apps record the same night, the one with the most sleep counts.
  • Mindful minutes, stand hours, handwashing and toothbrushing.

It sends what is new each time you open the app, on background refreshes, and when Apple Health wakes it in the background with new data. A day sent again replaces what the server had for it, so nothing is counted twice. Pocket Health lists it as Pocket Homelab app under Settings → Phone & imports → Sources seen.

On Home

The Health card shows today’s steps, with last night’s sleep and the goals met under it; the wide card adds active energy, exercise, resting heart rate, weight, the week’s workouts and medications due. Its headline can be Last night’s sleep or Goals met today instead (Settings → Home layout), and Today’s steps and sleep can be the Home header. Tapping it opens the Health screen. It appears by itself once Health is connected; search finds it as Health. The Mac’s Home has the same card.

The Health screen

  • Today: steps, active energy, exercise, last night’s sleep, resting heart rate and weight, from the server.
  • This week: workouts, goals met today and medications due.
  • Apple Health: when it last sent, what it sent, days still to send, and Sync now. Pull down to sync and refresh. Options: Send everything again (after resetting the server, or when you allowed a type later), Choose what to share… (opens the Health app; Sharing → Apps → Pocket Homelab) and Stop sending.
  • Charts, goals and medications and Phone & imports open Pocket Health itself.