Deploy Grocy
Household manager for groceries, expiry dates, recipes and chores
Just deployed
/config
Deploy and Host Grocy on Railway
Grocy is a self-hosted groceries and household management system — "ERP beyond your fridge". It tracks what is in your kitchen, when each item is due and what needs buying again, then extends the same idea to recipes, meal plans, chores, tasks, batteries and equipment manuals. It is a small PHP application with a REST API behind every screen, MIT-licensed and built by Bernd Bestel, for when a shared shopping list stops being enough.
Deploy Grocy on Railway and you get one service that already knows how to run here. The image is built on ghcr.io/linuxserver/grocy — nginx and PHP-FPM under s6 supervision — with a boot step that creates the admin account from your own credentials instead of leaving Grocy's documented admin / admin login in place, generates the web server configuration for Railway's assigned port, serves an unauthenticated health route that reads through the migrated database, and hardens the session cookie. One volume at /config holds the database, pictures and nightly backups.

Getting Started with Grocy on Railway
Deploy the template, optionally set GROCY_ADMIN_USERNAME and GROCY_ADMIN_PASSWORD, and open the generated public URL. You land on a login screen — sign in with those credentials. If you left the password unset, a strong one is generated on first boot and written to /config/initial-admin-password.txt on the volume. Grocy's documented admin / admin login is never created here.
Once inside, start with Manage master data: add the locations you really store food in, a few product groups, and the quantity units you buy in. Then create two or three products and book them in through Purchase with a due date each — that step is what makes the rest work, because the stock overview, the "due soon" counters and the shopping list all derive from stock entries. Consume something and check the Journal to confirm the booking landed. To verify the deployment end to end, add a chore, track an execution, and watch the next estimated date move. Everything in the interface is also on the REST API at /api, documented by the Swagger UI Grocy serves there.

About Hosting Grocy
Grocy solves a problem no shopping-list app touches: knowing what you already own and when it goes off. Households self-host it because the data — what you buy, eat and throw away — is personal.
- Stock management with locations, due dates, opened tracking, freezing, price history and a full journal
- Shopping list that auto-adds products falling below a minimum stock amount
- Recipes and meal plan that check ingredients against stock and push what is missing to the list
- Chores and tasks with flexible schedules and per-user assignment
- Batteries and equipment for charge cycles and instruction manuals
- Barcode support — USB scanner, device camera, and Open Food Facts lookups
- REST API and userfields, so custom columns and outside integrations are first-class
The deployment is deliberately one service. Grocy keeps everything in a single SQLite file, which suits a household dataset — but it means the volume is the deployment. A nightly job writes a consistent VACUUM INTO copy into /config/backups and keeps the last seven.
Why Deploy Grocy on Railway
Railway removes the parts of self-hosting Grocy that have nothing to do with groceries.
- One-click deploy with HTTPS and a public domain already issued
- A persistent volume for the SQLite database, pictures and backups
- No reverse proxy, certificate renewal or server patching to own
- Usage-based pricing that suits a low-traffic household app
- Redeploys pick up new Grocy releases without touching your data
Common Use Cases
- Household stock and waste tracking — what is in the freezer, what expires this week, what gets thrown away
- Meal planning against real inventory — plan a week and let Grocy put only the missing ingredients on the list
- Shared chore and task rotas — recurring chores with assignment, plus a task board for one-off jobs
- Small kitchen or café mise en place — a lighter alternative to spreadsheets for par levels
Dependencies for Grocy
ghcr.io/linuxserver/grocy:latest— nginx, PHP 8.5 and Grocy under s6, extended for Railway by gridalpha/grocy-railway- A Railway volume at
/config— database, pictures, generated web server configuration and backups - No external database, cache or object storage. Grocy uses SQLite by design and has no other storage backend
Environment Variables Reference
| Variable | Default | What it does |
|---|---|---|
GROCY_ADMIN_USERNAME | admin | Username of the first account |
GROCY_ADMIN_PASSWORD | generated | Password for that account; changing it rotates the password on the next deploy |
PORT | 80 | Port the web server listens on |
TZ | Etc/UTC | Timezone used by the app and by scheduled backups |
GROCY_CURRENCY | USD | ISO 4217 code used to format prices |
GROCY_DEFAULT_LOCALE | en | Fallback interface language |
GROCY_ENERGY_UNIT | kcal | Unit shown for energy values |
GROCY_ENTRY_PAGE | stock | Page Grocy opens on after login |
GROCY_BACKUP_KEEP | 7 | Nightly database backups retained |
Any setting in Grocy's config-dist.php works as GROCY_ — GROCY_FEATURE_FLAG_BATTERIES=false hides a section you do not use. Leave GROCY_MODE alone: anything but production disables authentication.
Deployment Dependencies
- Source: github.com/grocy/grocy
- Image: linuxserver/grocy
- Docs and add-ons: grocy.info and grocy.info/addons
Hardware Requirements for Self-Hosting Grocy
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 0.5 vCPU | 1 vCPU |
| RAM | 256 MB | 512 MB |
| Storage | 1 GB volume | 5 GB volume |
| Runtime | PHP 8.5, SQLite 3.40+ | Provided by the image |
Grocy is small: a household instance with a few hundred products and years of journal history stays in the low tens of megabytes.
Self-Hosting Grocy with Docker
The quickest way to run Grocy outside Railway is the LinuxServer image with a bind-mounted config directory. The following is a docker run invocation:
docker run -d \
--name grocy \
-e PUID=1000 -e PGID=1000 -e TZ=Etc/UTC \
-p 9283:80 \
-v /srv/grocy:/config \
--restart unless-stopped \
ghcr.io/linuxserver/grocy:latest
Grocy is also a plain PHP application that runs on any web server. These commands set up a release by hand:
curl -L https://releases.grocy.info/latest -o grocy.zip
unzip grocy.zip -d /var/www/grocy
cp /var/www/grocy/config-dist.php /var/www/grocy/data/config.php
chown -R www-data:www-data /var/www/grocy/data
Point the web root at public/ and add try_files $uri /index.php$is_args$query_string; to the location block. On either path the first login is admin / admin and must be changed immediately.
How Much Does Grocy Cost to Self-Host?
Grocy is free and open source under the MIT license. There is no paid tier, no hosted edition and no feature behind a subscription, so the only cost is infrastructure. On Railway that is usage-based charges for one small container and one volume.
FAQ
What is Grocy? Grocy is a self-hosted, MIT-licensed web application for managing a household: groceries and stock with due dates, a shopping list, recipes and meal plans, chores, tasks, batteries and equipment. It is written in PHP and keeps everything in one SQLite file.
What does this Railway template deploy?
One service running Grocy behind nginx and PHP-FPM, with a persistent volume at /config for the database, pictures and nightly backups. The admin account is created from your own variables at first boot, and a health check confirms the database is migrated before traffic reaches the container.
Why is there no separate database service?
Grocy only supports SQLite — there is no PostgreSQL or MySQL backend in the codebase. One file on a persistent volume is the whole storage layer, which is why a nightly job keeps the last seven backups in /config/backups.
How do I change the Grocy admin password after deploying?
Change it inside Grocy under the user menu, or update GROCY_ADMIN_PASSWORD and redeploy. The account is only rewritten when that variable actually changes, so a password you set in the interface survives later deploys.
Can I scan barcodes with self-hosted Grocy? Yes. Fields with a barcode icon accept a USB scanner, and the camera button uses the device camera over HTTPS, which the Railway domain provides. Unknown barcodes are looked up against Open Food Facts, and add-ons such as Barcode Buddy use the same REST API.
Does Grocy work with Home Assistant? Yes. A community Home Assistant integration reads stock, chores and tasks over Grocy's REST API, so a Railway-hosted instance can drive dashboards and automations. Create an API key under the user menu and point it at your public URL.
Template Content
