Deploy Grocy — Self-Hosted Groceries & Household Manager
Self-host Grocy — track groceries, expiry, recipes & chores
Just deployed
/config
Deploy and Host Grocy on Railway
Grocy is an open-source "ERP for your kitchen" — a self-hosted household management system for tracking groceries, expiration dates, recipes, meal plans, chores, and household tasks. Know exactly what's in your pantry, fridge, and freezer, get warned before food spoils, plan meals from what you have, and manage recurring chores, all from a clean web app you own. This template deploys Grocy with a persistent volume and the Nginx DNS fix that Railway deployments need — so your household inventory is live and reliable, no config editing required, in minutes.
What This Template Deploys
| Service | Purpose |
|---|---|
| Grocy | The full household manager — inventory, recipes, chores, and web UI (Nginx + PHP + SQLite) |
A single, lightweight service — no external database. The LinuxServer.io image bundles Nginx, PHP, and SQLite into one efficient container, with a persistent volume at /config holding the database, product images, and settings, so your data survives every redeploy.
About Hosting
Grocy is simple and light, and one Railway-specific fix is the difference between a reliable deploy and a crashing one — this template includes it.
The Nginx IPv6 resolver fix — why this template works on Railway. The standard LinuxServer.io Grocy image crashes on Railway because its Nginx tries to use IPv6 DNS formatting that Railway's internal network doesn't provide, causing the container to fail on startup. This template ships a custom init script (/custom-cont-init.d/99-fix-resolver) that forces Nginx to use a standard IPv4 DNS resolver, so the service starts reliably out of the box — no manual config edits, no crash loop. This is the difference between a Grocy that deploys cleanly here and one that doesn't.
The /config volume holds your entire household — persist it. Grocy stores everything under /config: the SQLite database (your whole inventory, recipes, chores, and history), product images, and application settings. This template mounts a persistent volume there, so all of it survives redeploys and updates — miss the volume and your entire household database is wiped on the next deploy.
One light container, no database to manage. Because the image bundles Nginx, PHP, and SQLite, there's no separate database service to provision or wire beyond the volume — Grocy runs comfortably on the smallest Railway plan.
Change the default credentials immediately. Grocy deploys with default login credentials, so open your Railway URL, sign in, and change the username and password in settings right away, since this is a web app on the public internet. Railway's automatic HTTPS secures the connection. Beyond a shopping list, Grocy tracks stock by location and quantity, warns on expiring products, generates shopping lists, stores and scales recipes, plans meals, and manages chores with due dates — a complete home-management system.
Typical cost: ~$5/month on Railway for the single lightweight container and volume. Grocy is MIT-licensed and free.
How It Compares
| Grocy (self-hosted) | Grocery apps (SaaS) | Spreadsheet | Notes app | |
|---|---|---|---|---|
| Inventory + expiry tracking | Yes | Some | Manual | No |
| Recipes + meal planning | Yes | Some | Manual | No |
| Chores + tasks | Yes | Rarely | Manual | Basic |
| Cost model | Flat infra (~$5/mo) | Subscription/ads | Free | Free |
| Data ownership | Full — your infra | Vendor | Yours | Vendor |
| Self-hostable | Yes | No | N/A | No |
Grocery SaaS apps are convenient but ad-supported or subscription-based and keep your household data on their servers. A spreadsheet is private but has no expiry warnings, recipe scaling, or chore scheduling. A notes app can't track stock or plan meals. Grocy's edge is a complete, purpose-built household ERP — inventory, expiry, recipes, meal plans, and chores in one tool — self-hosted at a few dollars a month, with your family's data on infrastructure you own.
Deploy in Under 5 Minutes
- Click Deploy on Railway — Grocy builds with the DNS fix and a persistent volume (~2 minutes)
- Confirm the volume is mounted at
/config - Open your Railway URL — Grocy loads reliably thanks to the resolver patch
- Log in with the default credentials, then change them immediately in settings
- Add your first products, locations, and quantities, and start tracking your household
Set the TZ variable to your timezone so due dates and expiry warnings are accurate.
Common Use Cases
- Pantry and fridge inventory — track what you have by location and quantity to avoid over-buying
- Reduce food waste — get warned before products expire and cook what's about to spoil first
- Meal planning — plan meals from your current stock and generate shopping lists automatically
- Recipe management — store recipes, scale servings, and check what ingredients you're missing
- Household chores — schedule recurring chores and tasks with due dates and assignments
Configuration
| Variable | Required | Description |
|---|---|---|
TZ | Recommended | Your timezone (e.g. America/New_York) for accurate dates |
PUID / PGID | Pre-set | User/group IDs for file permissions (LinuxServer.io standard) |
| Storage volume | Pre-set | Persistent volume at /config — database, images, and settings |
PORT | Pre-set | Served internally on port 80; Railway routes to it |
The DNS fix makes it work, and
/configholds everything. This template's Nginx IPv4-resolver patch prevents the crash the stock image hits on Railway, and the/configvolume stores your entire database and settings — mounted here so nothing is lost on redeploy.
Change the default login immediately. Grocy ships with default credentials — sign in and change them in settings right after deploy, since this is a public web app. Set
TZfor correct expiry and due dates.
Dependencies for Grocy Hosting
- Railway account — ~$5/month for the single lightweight container
- A persistent volume at
/configfor the database, images, and settings (included) - Nothing else — no external database, cache, or additional services
- A web browser, or the Grocy companion mobile apps, to manage your household
Deployment Dependencies
- Grocy Official Site
- Grocy GitHub Repository
- LinuxServer.io Grocy Image
- Railway Volumes Documentation
Implementation Details
The template runs the LinuxServer.io Grocy image (lscr.io/linuxserver/grocy), which bundles Nginx, PHP-FPM, and SQLite into a single Alpine-based container managed by s6-overlay, served internally on port 80. A persistent volume is mounted at /config, which holds the SQLite database, product images, and application configuration — the entire application state — so data persists across redeploys and updates while the application code stays immutable in the image.
The key Railway-specific adaptation is a custom init script at /custom-cont-init.d/99-fix-resolver that forces Nginx to use a standard IPv4 DNS resolver. The stock image's Nginx configuration assumes IPv6 DNS formatting that Railway's internal network environment does not provide, which crashes the container on startup; the patch resolves this so the service starts reliably without manual configuration. Standard LinuxServer.io PUID, PGID, and TZ variables control file permissions and timezone.
Grocy stores all data in SQLite on the volume, so no external database is required, keeping the stack to a single service. The application deploys with default credentials that should be changed immediately after first login. Grocy also exposes a REST API and has companion mobile apps for barcode-based stock management.
Frequently Asked Questions
Why does this template work on Railway when the stock image crashes? The standard LinuxServer.io Grocy image's Nginx expects IPv6 DNS formatting Railway doesn't provide, crashing the container. This template injects an init script forcing an IPv4 DNS resolver, so it starts reliably with no manual configuration.
Does my household data persist? Yes — the SQLite database, product images, and settings all live on the /config volume and survive redeploys and updates. Back up the volume to preserve your entire household inventory and history.
Do I need a separate database? No — the image bundles SQLite, so all data lives on the /config volume with no external database to provision or wire. This keeps the stack to a single lightweight container.
How do I log in the first time? Grocy deploys with default credentials — sign in with them, then change your username and password immediately in settings, since the app is on the public internet.
Why should I set the timezone? Grocy uses TZ for expiration warnings and chore due dates, so setting it to your timezone keeps those accurate. Set it in the Variables tab after deploy.
What can Grocy actually track? Stock by location and quantity, expiration dates, shopping lists, recipes with scaling, meal plans, and recurring chores and tasks — a complete household management system, not just a grocery list.
Why Deploy Grocy 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 Grocy on Railway you get a complete household manager with the hard parts solved — the Nginx DNS fix so it runs reliably, a persistent volume for your data, and automatic HTTPS. Track groceries, expiry dates, recipes, and chores, self-hosted on infrastructure you own.
Template Content
