Deploy Open Wearables
Self-hosted API for Garmin, Oura, Whoop and Apple Health data, with MCP.
celery-beat
Just deployed
Just deployed
/var/lib/postgresql/data
celery-flower
Just deployed
Redis
Just deployed
/data
frontend
Just deployed
celery-worker
Just deployed
backend
Just deployed
Deploy and Host Open Wearables on Railway
Open Wearables is an MIT-licensed platform that puts Garmin, Oura, Whoop, Polar, Suunto, Fitbit, Strava, Apple Health and more behind one normalized health data API, with webhooks, mobile SDKs and a built-in MCP server for AI agents. Hosted wearable APIs are expensive: Terra starts at $499/month and Junction's Launch plan is $300/month. Self-hosted Open Wearables on Railway costs a fraction of that, and your users' health data stays in your own database.
What This Template Deploys
| Service | Purpose |
|---|---|
| backend | The FastAPI application: the unified REST API, provider OAuth flows, webhooks, the MCP server and interactive API docs at /docs. Public HTTPS domain. |
| frontend | The developer portal (SvelteKit): create API keys, manage users, share connection links and invite teammates. Public HTTPS domain. |
| celery-worker | Runs background jobs: syncing data from providers, processing imports and sending webhooks. |
| celery-beat | Schedules the recurring sync jobs that keep every connected user's data fresh. |
| celery-flower | Monitoring dashboard for the Celery task queue. |
| Postgres | Postgres 18 storing users, normalized health data, API keys and provider tokens, on a persistent volume at /var/lib/postgresql/data. |
| Redis | Redis 8.2 as the Celery broker and cache, password-protected and persisted to a volume at /data. |
All seven services are connected through Railway reference variables on the private network: database and Redis credentials, the shared secret key and the public URLs are wired in at deploy time.
About Hosting Open Wearables
Supporting several wearables in a health app means a separate OAuth flow, data format, rate limit and sync schedule for every provider, plus the work of keeping up with their API changes. Hosted aggregators solve that for a monthly fee and per-connection charges, and every user's heart rate, sleep and workouts pass through their servers.
Open Wearables does the same job on your own infrastructure. Users connect their devices through a link, data syncs in the background, and your app reads one consistent model for activity, sleep, workouts, heart rate, HRV, SpO2, weight and more. On Railway, the backend, workers, scheduler, Postgres and Redis run together from the first deploy, with HTTPS, private networking and persistent storage.
Change the admin login before you share the portal. If ADMIN_EMAIL and ADMIN_PASSWORD are empty, the first admin account is created as admin@admin.com with the password your-secure-password. Set both on the backend service before deploying, or change the password in the portal right after your first login. Setting them after an account exists has no effect.
Typical cost: ~$15–30/month on Railway for all seven services at small scale. Terra's entry plan is $499/month and Junction's is $300/month, before you add users.
Deploy Open Wearables in Under 10 Minutes
- Before deploying, set
ADMIN_EMAILandADMIN_PASSWORDon the backend service. - Click Deploy on Railway. The app images build and Postgres and Redis start (several minutes for the first build).
- Open the frontend domain and sign in with your admin account.
- Create an API key in the developer portal and open the backend's
/docspage to try the API. - Add OAuth credentials for the providers you need on the backend service, then send a user a connection link.
No OAuth plumbing per provider. No queue setup. No per-connection fees.
Common Use Cases
- Self-hosted Terra or Junction alternative. One wearables API for your product without a monthly platform fee per tier.
- AI health coaches and agents. Ground answers in real sleep, activity and workout data through the MCP server or the API.
- Fitness and coaching apps. Personalized training based on Garmin, Whoop, Oura or Apple Health data from each client.
- Healthcare and wellness platforms. Aggregate patient or member data and get webhooks when new data arrives.
- Personal health data hub. Connect your own devices, keep the data on your own server and chat with it in Claude or Cursor.
- Automation. Trigger n8n or your own code from webhooks when a workout or sleep session syncs.
Configuration
| Variable | Service | Required | Description |
|---|---|---|---|
ADMIN_EMAIL | backend | Optional | Email for the first admin account. Set it before the first deploy. |
ADMIN_PASSWORD | backend | Optional | Password for the first admin account. Set it before the first deploy. |
SECRET_KEY | backend | 🔐 Auto-generated | Signs logins and encrypts stored provider tokens. Keep it stable. |
CORS_ORIGINS | backend, workers | ✅ Auto-injected | Allowed origins, set to the frontend's public URL. |
VITE_API_URL | frontend | ✅ Auto-injected | The backend's public URL that the portal calls. |
DB_HOST, DB_NAME, DB_USER, DB_PASSWORD | app services | ✅ Auto-injected | Postgres connection over the private network. |
REDIS_HOST, REDIS_PASSWORD | app services | ✅ Auto-injected | Redis connection for the Celery queue and cache. |
ACCESS_TOKEN_EXPIRE_MINUTES | backend | Optional | Portal login lifetime in minutes, 60 by default. |
SENTRY_ENABLED | backend | Optional | false by default. Enable to report errors to Sentry. |
Using a custom domain? Add it to the frontend (and backend, if you want an API domain), then update VITE_API_URL on the frontend and CORS_ORIGINS on the backend to the new URLs and redeploy. Without this, the portal can't reach the API.
Open Wearables vs. Alternatives
| Open Wearables on Railway | Terra API | Junction | Building integrations yourself | |
|---|---|---|---|---|
| Monthly cost | ~$15–30 usage | From $499 ($399 annual) | $300 Launch plan | Engineering time per provider |
| Self-hosted | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
| Per-connection fees | ✅ None | ❌ Credits per connection | ⚠️ Plan limit of 500 users | ✅ None |
| Health data stays in your database | ✅ Yes | ❌ No | ❌ No | ✅ Yes |
| Unified data model | ✅ Built in | ✅ Yes | ✅ Yes | ❌ You build it |
| MCP server for AI agents | ✅ Built in | ⚠️ Not core | ⚠️ Not core | ❌ No |
| License | ✅ MIT | ❌ Proprietary | ❌ Proprietary | Your own code |
Dependencies for Open Wearables Hosting
- Railway account. Hobby works to start; Pro gives headroom as users and sync volume grow.
- OAuth developer credentials from each wearable provider you want to support.
- A mobile app with the Open Wearables SDK if you need Apple Health, Samsung Health or Health Connect, which sync from the phone.
Deployment Dependencies
- Open Wearables on GitHub: source and releases
- Open Wearables Documentation: providers, API reference and deployment
- Supported providers: setup steps for each provider
- Railway Volumes Documentation: persistence for Postgres and Redis
Implementation Details
The backend, frontend and the three Celery services are built from the the-momentum/open-wearables repository. The worker, scheduler and Flower share the backend's database, Redis and SECRET_KEY through reference variables, so tokens encrypted by the API can be read by the background jobs.
Open Wearables is under active development (version 0.10 at the time of writing), so read the release notes before upgrading and back up Postgres first.
Frequently Asked Questions
What is Open Wearables? An open-source platform that connects wearable devices and health apps through one API. Your app reads normalized activity, sleep, workout and vitals data instead of integrating each provider separately.
How much does it cost compared to Terra or Junction? About $15–30/month on Railway at small scale. Terra starts at $499/month and Junction's Launch plan is $300/month for up to 500 connected users.
Why can't I log in, or which password is the admin account using?
If you didn't set ADMIN_EMAIL and ADMIN_PASSWORD before the first deploy, sign in as admin@admin.com with your-secure-password, then change the password immediately.
Do I lose health data when Railway redeploys? No. Users, health data and provider tokens are stored in Postgres on its volume, and Redis persists to its own volume.
Which wearables and apps are supported? Cloud providers including Garmin, Oura, Whoop, Polar, Suunto, Ultrahuman, Strava, Fitbit, Withings and Google Health, plus Apple Health, Samsung Health and Health Connect through the mobile SDK.
Can AI agents read the data? Yes. The built-in MCP server works with Claude Desktop, Cursor and other MCP clients, so you can ask questions about users' sleep, workouts and vitals in plain language.
Why Deploy and Host Open Wearables on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Open Wearables on Railway, you get one API for every major wearable, background syncing, webhooks and AI access, with your users' health data in your own database and no per-connection fees.
Template Content
celery-beat
the-momentum/open-wearablescelery-flower
the-momentum/open-wearablesRedis
redis:8.2.1frontend
the-momentum/open-wearablescelery-worker
the-momentum/open-wearablesbackend
the-momentum/open-wearables