Skip to main content
The datasource container starts empty: food search returns nothing until you import at least one catalog. Each catalog is independent and builds into its own database file, so you can import them in any order and the service serves whatever is present. Imports never interrupt the running service — each one builds a new file, verifies it, then swaps it in atomically. Run all commands from the selfhost/ directory unless otherwise noted.
USDA FoodData Central contains generic whole foods with lab-measured nutrition data, all in the public domain. This is the catalog that makes a search for “chicken breast” return an actual ingredient rather than a supermarket SKU. Start here — it is the most useful single catalog for day-to-day logging.The download is approximately 3.1 GB and the import takes a few minutes.
1

Download the USDA dataset

From the selfhost/ directory, download and unzip the USDA CSV export:
2

Copy the files into the container

3

Run the import

4

Clean up the temporary files

Checking import stats

To see how many records are in each catalog currently serving requests:

Rolling back an import

Each import keeps the previous database file so you can roll back if something goes wrong. To revert a catalog to its previous state:
The datasource README at apps/datasource/README.md documents how the catalogs are ranked, the de-duplication passes that run during import, and how search merges results across catalogs when more than one is loaded.