Ghost includes a data generator for building repeatable local datasets. Use it instead of copying data from a real publication.
From the repository root, run:
pnpm reset:dataThis clears generated data from the Docker development database, preserves the owner account, and creates 1,000 members and 100 posts using a fixed seed.
Other prepared datasets are available:
pnpm reset:data:empty
pnpm reset:data:xxlreset:data:empty keeps the owner but generates no members or posts.
reset:data:xxl creates two million members for testing behaviour at scale.
These commands are destructive and require the Docker development environment
to be running. Do not point the generator at a database containing data you
need to keep. Restart pnpm dev after resetting data so running processes do
not retain state from the old dataset.
Run the generator inside the development container when the prepared datasets do not cover the scenario:
docker exec ghost-dev bash -c \
'cd /home/ghost/ghost/core && node index.js generate-data \
--clear-database --quantities members:10000,posts:500 --seed 123'The generator supports:
--clear-databaseto clear the tables being generated while preserving the owner account;--tables=members:10000,posts:500to generate only named tables and their dependencies, with optional quantities;--with-defaultto add the other default tables when using--tables;--quantities=members:10000,posts:500to override quantities without changing which default tables are generated;--base-data-pack=/path/to/data.jsonto import compatible newsletters, posts, tags, products, settings, and custom theme settings before generating the remaining tables. Importing a base pack replaces the existing settings;--seed=123to make generated values repeatable. Timestamps can still move so that generated content remains current;--print-dependenciesto show the table dependency order without importing.
Use --tables for a narrow dataset and --quantities when the relationships
from the full default dataset matter. The generator adds required table
dependencies automatically and rejects unknown table names.
For the implementation and instructions for adding an importer, see the data generator README.