Grocy on a VPS: Self-Hosted Grocery and Household Management Beyond the Fridge

Grocy on a VPS: Self-Hosted Grocery and Household Management Beyond the Fridge

Grocy is a self-hosted web app for household management — it tracks grocery inventory with expiry dates and barcode scanning, manages recipes and meal planning, schedules recurring household tasks (filter changes, equipment maintenance), and generates shopping lists based on what you’re actually running low on. It’s described by its developer as a “ERP for your home.” For households that regularly throw away expired food or forget maintenance schedules, Grocy provides structured tracking that cloud apps charge subscriptions for.

What Grocy Tracks

  • Stock: Current inventory of every product, quantities, and expiry dates
  • Shopping list: Auto-generated from minimum stock levels or manually curated
  • Recipes: Ingredient lists with automatic stock consumption when cooking
  • Meal plan: Schedule meals for the week, auto-update shopping list
  • Tasks: Recurring chore schedules (water plants every 3 days, change HVAC filter every 90 days)
  • Equipment: Track appliances with maintenance schedules and warranty info
  • Batteries: Track which devices have which batteries and when they were last replaced

Step 1: Docker Compose Setup

<code">mkdir -p /opt/grocy && cd /opt/grocy
nano docker-compose.yml
<code">version: '3.8'

services:
  grocy:
    image: lscr.io/linuxserver/grocy:latest
    container_name: grocy
    restart: always
    ports:
      - "127.0.0.1:9283:80"
    environment:
      PUID: 1000
      PGID: 1000
      TZ: America/New_York    # Set your timezone
      GROCY_MODE: production
      GROCY_CURRENCY: USD
      GROCY_CULTURE: en
    volumes:
      - ./config:/config
<code">mkdir -p config
docker compose up -d
docker compose logs -f grocy

Step 2: Nginx Reverse Proxy

<code">sudo nano /etc/nginx/sites-available/grocy
<code">server {
    listen 80;
    server_name grocy.yourdomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name grocy.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/grocy.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/grocy.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:9283;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
<code">sudo ln -s /etc/nginx/sites-available/grocy /etc/nginx/sites-enabled/
sudo certbot --nginx -d grocy.yourdomain.com
sudo systemctl reload nginx

Step 3: Initial Configuration

  1. Visit https://grocy.yourdomain.com
  2. Default credentials: admin / admin — change immediately
  3. Settings → Stock:
    • Underfull amount: 25% (alert when stock drops below this)
    • Default due days: 7 (for fresh produce)
    • Display days due soon: 5 (show items expiring in 5 days)
  4. Settings → User management → create accounts for household members

Step 4: Add Products and Stock

<code"># Grocy has a product database that you populate:
# Products → + → Add product
# - Name: "Organic Whole Milk"
# - Barcode: 012345678901 (scan or enter)
# - Default quantity: 1 gallon
# - Min stock: 1 (shopping list triggers at 0)
# - Default due days: 14 (milk expires in 2 weeks)

# Stock → Purchase → add stock entry:
# - Product: Organic Whole Milk
# - Amount: 2
# - Price: $5.99
# - Best before: 2025-03-15

# Consume stock (when you use something):
# Stock → Consume → Organic Whole Milk → Amount: 1

Step 5: Mobile Barcode Scanning

<code"># Grocy has a companion Android app: "Grocy" (also works on iOS via browser)
# The app uses your camera for barcode scanning

# When scanning a new product barcode:
# 1. App opens camera → scan barcode
# 2. If barcode exists in Open Food Facts: auto-fills product name and details
# 3. If new: prompts to add as new product

# Open Food Facts integration (auto-fill product info):
# Settings → Integrations → Open Food Facts: enabled
# Now scanning a barcode auto-fills: name, brand, picture, category

# Shopping mode: walk through store, scan and add items to stock

Step 6: Recipes and Meal Planning

<code"># Create a recipe:
# Recipes → + → New recipe
# Name: "Pasta Carbonara"
# Add ingredients: pasta (200g), eggs (3), parmesan (50g), pancetta (100g)
# Instructions: (optional — just link to a URL)

# Add recipe to meal plan:
# Meal plan → select day → + → select recipe
# Grocy auto-adds missing ingredients to shopping list

# Cook a recipe (consume stock):
# Recipes → Pasta Carbonara → Consume
# Stock reduces by recipe quantities automatically

Step 7: Tasks and Maintenance

<code"># Recurring tasks:
# Tasks → + → New task
# Name: "Water plants"
# Due date: today
# Assigned to: yourself
# Period: every 3 days (Grocy reschedules after you mark done)

# Equipment maintenance:
# Equipment → + → New equipment item
# Name: "HVAC Filter"
# Due date: 90 days from last replaced
# Instruction: "Buy MERV-13 20x20x1 filter, replace and vacuum area"

# Battery tracking:
# Batteries → + → New battery
# Name: "TV Remote"
# Charge interval: 365 days
# Charge cycles: count replacements

Step 8: API Integration

<code"># Grocy has a REST API — automate stock updates
API_KEY="your_grocy_api_key"  # Settings → Manage API keys

# Add stock via API (from smart scale, home automation, etc.):
curl -X POST https://grocy.yourdomain.com/api/stock/products/1/add \
  -H "GROCY-API-KEY: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 2, "best_before_date": "2025-04-01", "price": 5.99}'

# Get current stock:
curl https://grocy.yourdomain.com/api/stock \
  -H "GROCY-API-KEY: $API_KEY" | python3 -m json.tool

# Get products below minimum stock (for automated shopping list):
curl https://grocy.yourdomain.com/api/stock/products/missing \
  -H "GROCY-API-KEY: $API_KEY"

Getting Started

Grocy uses under 50 MB RAM — it runs on the smallest Ubuntu VPS at VPS.DO alongside many other services. The self-hosted approach means your household inventory data stays private. For households where one VPS already serves other tools (Vaultwarden, Immich, Nextcloud), Grocy adds essentially zero marginal cost. The Open Food Facts barcode database covers millions of products worldwide, making initial product population fast.

Conclusion

Self-hosted Grocy provides structured household inventory management — grocery tracking with barcode scanning, recipe-based meal planning, recurring task scheduling, and equipment maintenance — without subscription fees or data sharing. The REST API enables home automation integration (automatically reduce stock when your smart scale detects a product being used), and the mobile-friendly interface makes scanning and consuming stock convenient. For households that want to reduce food waste and maintain systems proactively, Grocy is the complete self-hosted home management solution.

Fast • Reliable • Affordable VPS - DO It Now!

Get top VPS hosting with VPS.DO’s fast, low-cost plans. Try risk-free with our 7-day no-questions-asked refund and start today!