Deploy NutriTrace
Private nutrition and macro tracker PWA with barcode scanning
nutritrace
Just deployed
/data
Deploy and Host self hosted NutriTrace (Other) on Railway
This template deploys NutriTrace, a self-hosted nutrition and macro tracker PWA, as independent community packaging of TraceApps/nutritrace v1.4.0 (AGPL-3.0). It is not affiliated with or endorsed by NutriTrace or TraceApps.
About Hosting NutriTrace open-source software on Railway (self hosted NutriTrace template)
Hosting NutriTrace on Railway means your food log, weight history, goals and uploaded photos sit in a SQLite database and uploads folder on a volume you control, not on a vendor's cloud.
Why Deploy NutriTrace, the self-hosted nutrition and macro tracker PWA on Railway
A hosted nutrition app keeps your food log, weight history and goals on someone else's servers, under their pricing. Railway's $5 free trial is enough to test it before you decide.
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 NutriTrace on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Railway vs Other Hosting Providers and VPS for NutriTrace self hosting
Choosing where NutriTrace and its volume live mostly comes down to how much server work you want to do.
| Provider | What You Get with Railway | What You Get with the Other Provider |
|---|---|---|
| DigitalOcean | One service with a /data volume and a health check on /api/auth/status. | Full droplet control, but you handle Docker, firewall, proxy and backups. |
| AWS | A managed deploy with generated secrets and the public port set for you. | Broad networking choices, but you assemble runtime, storage and TLS yourself. |
| Hetzner | The same one-click setup with no server administration. | Inexpensive servers with plenty of resources, and you manage the host and updates. |
Common Use Cases for hosted NutriTrace
- Private daily food log: Log what you eat each day in your own instance, so your meal history stays on infrastructure you control rather than with a hosted nutrition app.
- Barcode-based logging: Scan or look up packaged foods through the upstream app's barcode lookup, then save the entries to your personal log in seconds.
- Macro and calorie tracking: Set targets for calories, protein, carbs and fat, then review how each day compares against them.
- Weight and goal tracking: Record body weight over time alongside your nutrition goals, and see how intake lines up with progress.
- Phone install as a PWA: Open your NutriTrace domain on a phone and install it as a web app, with all data kept in SQLite on the persistent /data volume.
Dependencies for NutriTrace Docker hosted on Railway
The template is one service with one persistent volume, running the unmodified upstream NutriTrace v1.4.0 image. Nothing needs wiring up before the first sign in.
Deployment Dependencies for Managed NutriTrace Service
The template deploys one service named nutritrace, public on port 8080. Keep one replica, because the local database sits on that single volume.
Implementation Details for NutriTrace
The image ghcr.io/onepush-dev/nutritrace:1.4.0 is the unmodified upstream ghcr.io/traceapps/nutritrace image, digest-pinned to v1.4.0 (sha256:2a7ddec27518660cfb71d5599b75a7bba65c41837f43d10519dfd1fd13b6dcbc), because upstream publishes only rolling latest and dev tags. The secrets are generated: JWT_SECRET, NUTRITRACE_ADMIN_PASSWORD and RECOVERY_TOKEN. The admin account is created on first boot so the setup wizard cannot be taken over. Sign in as admin, then change the password. Keep JWT_SECRET stable. The local Open Food Facts mirror is not enabled.
How does NutriTrace compare against other tools
NutriTrace vs a Hosted Nutrition App (Hosted Nutrition App Alternative)
- Data location: NutriTrace keeps the SQLite database and uploads on your own /data volume, so your food log stays under your control.
- Cost model: NutriTrace is AGPL-3.0 open-source software, so you pay only for the infrastructure you run it on.
- Where hosted apps win: Hosted apps usually offer larger food databases and polished mobile apps, with no server to maintain.
NutriTrace vs Logging Meals Only in a Spreadsheet (Spreadsheet Food Log Alternative)
- Barcode lookup: NutriTrace includes barcode lookup backed by Open Food Facts, so packaged foods do not need manual entry.
- Macros and goals: NutriTrace tracks macros, weight and goals in one app, instead of formulas you maintain yourself.
- Where spreadsheets win: A spreadsheet needs no deployment and is simpler for a short, one-off log.
NutriTrace with Docker vs Railway (Docker on Railway Alternative)
- Setup effort: Railway runs the digest-pinned image from one template with zero inputs, while plain Docker means managing the container and restarts yourself.
- Persistence: Railway attaches a volume at /data and keeps one replica for local persistent state.
- Where plain Docker wins: A Docker host gives you full control over networking and resource limits that Railway abstracts away.
How to use NutriTrace on Railway?
Follow these steps on your first day after the deploy finishes.
- Open the public domain Railway assigned to the nutritrace service and load the app in your browser.
- Sign in as admin with the generated NUTRITRACE_ADMIN_PASSWORD from the service Variables tab.
- Change the admin password inside the app so the generated value is no longer your everyday login.
- Copy RECOVERY_TOKEN from the Variables tab and store it in a password manager, since it unlocks the login page if you get locked out.
- Keep the service at one replica, because the SQLite database and uploads live on the single /data volume.
- Confirm the health check at /api/auth/status returns healthy before you start logging meals.
Health check path: /api/auth/status
Public port: 8080
Volume mount: /data
Replicas: 1
How to self host NutriTrace on other VPS Services (NutriTrace self hosting guide)
Clone the Repository
Start on a Linux server with Docker installed. Clone the upstream project so you can read its docs and compose files.
git clone https://github.com/TraceApps/nutritrace.git
cd nutritrace
Install Dependencies
You only need Docker and a way to reach the server over HTTPS. Upstream runs as a container, so no Node toolchain is required on the host.
Configure Environment Variables
Generate your own secrets rather than reusing anything from this page. Keep JWT_SECRET stable, since changing it invalidates sessions and affects stored tokens.
export JWT_SECRET="$(openssl rand -hex 32)"
export NUTRITRACE_ADMIN_PASSWORD="your-strong-admin-password"
export RECOVERY_TOKEN="$(openssl rand -hex 16)"
Start the NutriTrace Application
Upstream: run the documented nutritrace container with a persistent /data path; see the upstream repository. Railway handles the public domain, TLS, the persistent volume and the health check on your behalf.
Pricing and License of NutriTrace (NutriTrace pricing)
NutriTrace is open-source software licensed under AGPL-3.0, so you can self-host it for free. Those optional integrations were not tested in this template, so check their own pricing before you enable them.
NutriTrace hosted vs self hosted comparison (Pricing, features, costs, and more)
This template packages the AGPL-3.0 software, and no hosted nutrition-app plan prices are quoted here. Costs depend on the infrastructure you choose.
Monthly cost of self hosting NutriTrace on Railway
Railway bills on usage, so the monthly cost depends on RAM, CPU, volume size and services. Check your own usage after a few days of real logging before you assume a monthly figure.
System Requirements for Hosting NutriTrace on a VPS
A VPS needs to run the Docker image and keep a persistent directory for the SQLite database and uploads. Back up the data directory, since the database and uploads live there.
Frequently Asked Questions (FAQs)
Which version of NutriTrace does this template run?
This template runs NutriTrace v1.4.0. The image is the unmodified upstream image, digest-pinned to v1.4.0 (sha256:2a7ddec27518660cfb71d5599b75a7bba65c41837f43d10519dfd1fd13b6dcbc), because upstream publishes only rolling latest and dev tags. It stays on that release until you change the pin.
Are the secrets generated for me?
Yes. JWT_SECRET, NUTRITRACE_ADMIN_PASSWORD and RECOVERY_TOKEN are generated when you deploy, so you do not need to enter any values. Keep JWT_SECRET stable, and store RECOVERY_TOKEN somewhere safe in case you lock yourself out.
How is the admin account created?
The admin account is created on first boot, before the public server starts. A short-lived process on private port 8081 registers the admin user, then the public server starts on 8080. This means the setup wizard cannot be taken over by someone who reaches the domain first.
How do I sign in for the first time?
Sign in with the username admin and the password stored in NUTRITRACE_ADMIN_PASSWORD. Change the password in the app once you are signed in. Open registration is closed after that first user, so further accounts are added by the admin.
What should I back up?
Back up the /data volume, which holds the SQLite database and uploads. Also keep JWT_SECRET and RECOVERY_TOKEN somewhere safe, since you need them to keep sessions stable and to recover a locked-out login. Optional SMTP, OIDC, AI photo logging and wearable connections were not tested in this packaging.
Is this affiliated with NutriTrace or TraceApps?
No. This is independent community packaging of TraceApps/nutritrace v1.4.0 (AGPL-3.0), and it is not affiliated with or endorsed by NutriTrace or TraceApps.
Template Content
nutritrace
ghcr.io/onepush-dev/nutritrace:1.4.0