Grocy
Overview
Grocy is a popular open-source, self-hosted groceries and household management solution, an ERP for your home. From an ordinary browser, you track your food stock and best-before dates, manage your shopping list, store recipes and meal plans, and schedule recurring chores, batteries and equipment. Everything runs through one clean web interface backed by a full REST API.
This SecureAnyCloud image serves Grocy 4.5.0 on a PHP 8.3 and nginx stack over a hardened Ubuntu 24.04 LTS base, patched at build time. Grocy keeps all data in a self-contained SQLite database, so there is no separate database server to run.
What you get:
- Grocy 4.5.0 served by nginx through the PHP 8.3 front controller, managed by systemd
- The Grocy web interface on
:80, with authentication required and demo mode disabled - A per-VM administrator password generated on first boot and recorded in a root-only file, so no shared or default login ever ships in the image
- A self-contained SQLite datastore, so there is no separate database server to provision
- A dedicated Azure data disk at
/var/lib/grocyfor the database, configuration and file storage nginx.serviceandphp8.3-fpm.serviceas enabled systemd units- 24/7 SecureAnyCloud support
Prerequisites
You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.
Standard_B2s (2 vCPU / 4 GiB RAM) is a sensible starting size. Size up for larger households and heavier concurrent use.
Configure the network security group (NSG) to allow inbound 22/tcp from your management network and 80/tcp for the web interface. Grocy serves plain HTTP on port 80, so for production, terminate TLS in front of it with your own domain.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Grocy by SecureAnyCloud, and select Create.
On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80).
Review the dedicated data disk on the Disks tab, then select Review + create and Create.
Step 2 - Deploy from the Azure CLI
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:grocy-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name grocy \
--image sac1647283583153:grocy-ubuntu-24-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku StandardOpen port 80 for the web interface:
az vm open-port --resource-group <your-rg> --name grocy --port 80Step 3 - Confirm the services are running
SSH in as azureuser and confirm that nginx and PHP-FPM are active. Also confirm the one-shot first-boot service that rotates the administrator password. nginx serves Grocy on port 80.
systemctl is-active nginx php8.3-fpm grocy-firstbootss -tlnp | grep ':80 ' | sed 's/ */ /g'Step 4 - Retrieve the per-VM administrator password
Every VM generates its own administrator password on first boot. It writes the password, together with the login user and URL, to a root-only credentials file. Read the file with sudo:
sudo cat /root/grocy-credentials.txtSign in to Grocy with the username admin and the grocy.admin.pass value from this file.
To prove the login works from the command line, establish an authenticated session with those credentials:
PASS=$(sudo grep '^grocy.admin.pass=' /root/grocy-credentials.txt | cut -d= -f2-);
CJ=$(mktemp); curl -s -c "$CJ" -o /dev/null http://127.0.0.1/login; curl -s -c "$CJ" -b "$CJ" -o /dev/null --data-urlencode "username=admin" --data-urlencode "password=$PASS" http://127.0.0.1/login;
BODY=$(curl -s -L -b "$CJ" http://127.0.0.1/); rm -f "$CJ"; case "$BODY" in *[Ll]ogout*|*"tock overview"*) echo "login OK";; *) echo "login FAILED";; esacStep 5 - Sign in to Grocy
Browse to http://<vm-public-ip>/. Grocy opens on its sign-in screen. Enter the username admin and the password from Step 4.
Step 6 - Track your food stock
After you sign in, you land on the stock overview. It lists every product you hold, the amount in stock and the next best-before date. Colour coding highlights items that expire soon, so you can use them before they go to waste.
Use the action buttons on each row to consume, open or add stock.
Step 7 - Manage your shopping list
Open Shopping list from the sidebar to see what needs buying, with quantities and a running total.
Grocy can add items automatically when stock drops below the minimum you set for a product. You can also add items by hand with the Add item button.
Step 8 - Schedule chores
Open Chores overview to manage recurring household tasks. Each chore has its own schedule. Grocy tracks when each chore was last done and when it is next due, and it highlights anything overdue.
Use the track button on a row to record that a chore has been completed.
Step 9 - Verify the stack
Confirm the Grocy version, check that the services are enabled, and confirm that the web interface answers on port 80:
python3 -c "import json;d=json.load(open('/var/www/grocy/version.json'));print('Grocy', d['Version'])"systemctl is-enabled nginx php8.3-fpmcurl -s -o /dev/null -w 'grocy HTTP %{http_code}\n' http://127.0.0.1/Step 10 - Where your data lives
The SQLite database (grocy.db), the configuration and your file storage all live on a dedicated Azure data disk mounted at /var/lib/grocy, separate from the OS disk.
This disk is captured into the image and re-provisioned on every VM. Confirm the mount and the filesystem:
df -h /var/lib/grocy | tail -1findmnt -no SOURCE,TARGET,FSTYPE /var/lib/grocySecurity notes
- Encrypt web traffic. Grocy serves plain HTTP on port 80. For production, put it behind your own TLS-terminating reverse proxy or an Azure Application Gateway with a certificate for your domain, and restrict port 80 in the NSG to trusted networks.
- Protect the administrator password. Authentication is required and demo mode is disabled, so no data is ever seeded and no shared login exists. The per-VM administrator password lives in
/root/grocy-credentials.txt, readable only by root. You can sign in and change it from the user menu. Keep a copy somewhere safe. - Scope your API access. Grocy exposes a full REST API. For integrations such as Barcode Buddy or Home Assistant, create scoped API keys from Manage API keys instead of sharing your login.
- Keep the VM patched. The image is patched at build time and ships with unattended security upgrades enabled.
Support
SecureAnyCloud images come with 24/7 support. For questions about this Grocy image or help with your deployment, contact us through the SecureAnyCloud website.
Deploy on Azure
Launch Grocy on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Grocy is an open-source, self-hosted groceries and household management solution, an ERP for your home. It tracks your food stock and best-before dates, manages your shopping list, stores your recipes and meal plans, and schedules your recurring chores, batteries and equipment. You use it all from one clean web interface and a full REST API.
This SecureAnyCloud image runs Grocy behind nginx, with PHP-FPM 8.3 and OPcache enabled.
What you get:
- A self-contained appliance. Grocy stores its data in SQLite, so there is no separate database server to install, secure or back up.
- The SQLite database, the configuration and the file storage under
/var/lib/grocy, on a dedicated, independently resizable EBS volume. You can grow your household data store without touching the operating system disk. - A database schema that is already initialised in the image, so there is no first-run setup. No demo data is shipped.
- An administrator password generated on the first boot of every deployed instance. Two instances launched from the same Amazon Machine Image never share credentials.
- The initial administrator password written to
/root/grocy-credentials.txtwith mode 0600, so that only the root user can read it.
Prerequisites
Before you deploy this image you need:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group that allows inbound port 22 from your management network. It must also allow inbound ports 80 and 443 from the networks your users browse from
- The AWS CLI (version 2) installed locally if you plan to deploy from the command line
Launch the Instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for Grocy. Select the SecureAnyCloud listing and choose Select, then Continue on the subscription summary.
Pick an instance type of m5.large or larger. Choose your EC2 key pair under Key pair (login).
Under Network settings, select your VPC and subnet. Create or select a security group that allows inbound port 22 from your management network and inbound ports 80 and 443 from the networks your users browse from. Leave the root and data volumes at their default sizes or larger.
Select Launch instance. First-boot initialisation takes approximately one minute after the instance state becomes Running and the status checks pass.
Launch the Instance from the AWS CLI
The following command launches an instance from the SecureAnyCloud Grocy Marketplace AMI into an existing subnet and security group. Replace the values in angle brackets:
- Replace <ami-id> with the AMI ID shown on the Marketplace listing.
- Replace <key-name> with your EC2 key pair name.
- Replace <subnet-id> with your subnet ID.
- Replace <security-group-id> with a security group that opens ports 22, 80 and 443 as described in Prerequisites.
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type m5.large \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":20,"VolumeType":"gp3"}}]' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=grocy-01}]'On success, the command prints a JSON document. Note the instance ID. Once the instance is running, retrieve its public address with aws ec2 describe-instances --instance-ids <instance-id> --query "Reservations[].Instances[].PublicIpAddress" --output text.
Connect and Retrieve Initial Credentials
Connect over SSH with the key pair you selected and the public IP address from Step 2. The SSH login user depends on the operating system of the AMI variant you launched. For Ubuntu 24.04, the SSH login user is ubuntu.
ssh -i /path/to/your-key.pem ubuntu@<public-ip>Grocy generates the administrator password on first boot and writes it to a root-only file. Retrieve it with:
sudo cat /root/grocy-credentials.txtThe file lists the administrator user (admin), the generated password and the instance URL. Store the password somewhere safe and treat it as a secret.
Sign In to Grocy
Open a web browser and browse to http://<instance-public-ip>/. You are taken to the Grocy sign-in page.
Sign in as the admin user with the password from /root/grocy-credentials.txt. After signing in, you land on the Stock overview.
Open the user menu at the top right and choose your own user. Change the administrator password to one of your choosing from inside the application.
Track Your Stock
The Stock overview is the heart of Grocy. It lists every product you have in stock, the amount on hand, the total stock value and the next due date. Rows are colour-coded so that overdue and soon-to-expire products stand out.
Use Purchase to book new stock in with a best-before date and price. Use Consume to book stock out as you use it. Use Inventory to correct the on-hand amount after a stock take.
Create your products under Manage master data. There you also define quantity units, locations, product groups and shopping locations. Each product can carry a minimum stock amount so that Grocy can tell you when you are running low.
Build a Shopping List
The Shopping list view collects everything you need to buy. Add items manually, or let Grocy populate the list from the products that have fallen below their minimum stock amount. Each item carries a quantity, and the list shows a running total value.
When you return from the shops, use Stock actions on the shopping list. It books the purchased items straight into stock.
Schedule Chores
The Chores overview turns recurring household tasks into a tracked schedule. Define a chore with a period (manually, daily, weekly, monthly or a custom number of days). Then track each execution. Grocy estimates the next due date and highlights overdue chores.
Grocy uses the same tracking model for Batteries (charge cycles) and Equipment (manuals and maintenance). It also has a Tasks module for one-off jobs.
Using the REST API
Grocy exposes a full REST API that mirrors the web interface. Create an API key from the user menu at the top right, under Manage API keys. Then call the API with the key in the GROCY-API-KEY header.
For example, to list the current stock:
curl -s -H "GROCY-API-KEY: <your-token>" http://<public-ip>/api/stockThe interactive API documentation is available in the application under the same menu. It is generated from the bundled OpenAPI specification.
Verify the Service on the Instance
To confirm that the stack is healthy, check the services and the listening port from the shell:
systemctl is-active nginx php8.3-fpmBoth units report active. Confirm nginx is serving on port 80:
sudo ss -tlnp | grep ':80 'Confirm the installed Grocy version and check that the data volume is mounted:
cat /var/www/grocy/version.json df -h /var/lib/grocyThe version file reports Grocy 4.5.0, and /var/lib/grocy is a dedicated ext4 volume holding the SQLite database (grocy.db), the configuration and file storage.
Enable HTTPS with Let's Encrypt
For production use, put Grocy behind HTTPS. Point a DNS A record at the instance's public IP and make sure inbound port 443 is open in the security group. Then install Certbot and obtain a certificate.
Replace your-domain.example.com with your fully qualified domain name and run the following on the instance:
sudo snap install --classic certbot
sudo ln -sf /snap/bin/certbot /usr/bin/certbotThen request and install a certificate for your domain with the nginx plugin. Use the command sudo certbot --nginx -d your-domain.example.com. Follow the interactive prompts to enter your email address and agree to the terms.
Certbot edits the nginx site to serve TLS and installs a renewal timer. After enabling HTTPS, browse to https://your-domain.example.com/.
Backup and Maintenance
All of your Grocy data lives under /var/lib/grocy, principally the SQLite database grocy.db. To back it up, stop the web stack briefly to ensure a consistent copy. Then archive the directory and start the stack again:
sudo systemctl stop nginx php8.3-fpm
sudo tar czf /tmp/grocy-backup.tar.gz -C /var/lib grocy
sudo systemctl start nginx php8.3-fpmCopy the resulting archive to durable storage such as Amazon S3. The data volume is a separate EBS volume, so you can also take EBS snapshots of it on a schedule for point-in-time recovery. You can resize it independently of the operating system disk as your household data grows.
Keep the operating system patched with sudo apt-get update && sudo apt-get -y upgrade.
To move to a newer Grocy release, follow the upgrade notes in the official Grocy documentation. Preserve the /var/lib/grocy data directory.
Support
This image is published and supported by SecureAnyCloud. Support covers Grocy deployment, upgrades, REST API integration, performance tuning and storage administration, 24/7 by email and chat. For questions about using Grocy itself, see the official Grocy documentation and community.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch Grocy on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com