docs/developer/create-spree-app/quickstart.mdx
npx create-spree-app@latest my-store
The CLI walks you through an interactive setup:
Once complete, your store is running at http://localhost:3000.
All prompts can be skipped with flags for non-interactive (CI/CD) usage:
npx create-spree-app@latest my-store --no-storefront --no-sample-data --no-start
| Flag | Description |
|---|---|
--no-storefront | Skip Next.js storefront setup |
--no-sample-data | Skip loading sample products and categories |
--no-start | Don't start Docker services after scaffolding |
--port <number> | Port for the Spree backend (default: 3000) |
--use-npm | Use npm as package manager |
--use-yarn | Use yarn as package manager |
--use-pnpm | Use pnpm as package manager |
my-store/
├── docker-compose.yml # Spree backend (prebuilt image) + Postgres + Redis
├── docker-compose.dev.yml # Alternative: build from local backend/
├── .env # SECRET_KEY_BASE, SPREE_PORT
├── .gitignore
├── package.json # Convenience scripts
├── README.md
├── backend/ # Full Rails app (from spree/spree-starter)
│ ├── Gemfile
│ ├── Dockerfile
│ ├── config/
│ ├── app/
│ └── ...
└── apps/
└── storefront/ # Next.js storefront (unless --no-storefront)
├── .env.local # API URL + API key
└── ...
ghcr.io/spree/spree:latest image on the configured port (default 3000)The backend/ directory contains a full Rails application with Spree installed (cloned from spree-starter). By default, the project uses a prebuilt Docker image. To switch to building from your local backend:
npx spree eject
This replaces docker-compose.yml with a version that builds from backend/, rebuilds the image, and restarts services. You can then:
backend/Gemfilebackend/app/models/backend/app/controllers/backend/config/initializers/spree.rbcd backend && bin/rails generate migrationSee the Customization Guide for more details.
The project includes @spree/cli for managing your Spree backend:
| Command | Description |
|---|---|
spree dev | Start backend services and stream logs |
spree stop | Stop backend services |
spree update | Pull latest Spree image and restart (runs migrations automatically) |
spree eject | Switch from prebuilt image to building from backend/ |
spree logs | View backend logs |
spree logs worker | View background jobs logs |
spree console | Rails console |
Open http://localhost:3000/admin and log in with:
[email protected] | |
| Password | spree123 |
The REST API is available at http://localhost:3000/api/v3/store. See the API Reference for details.
If you included the storefront, start it in a separate terminal:
cd my-store/apps/storefront
npm run dev
Open http://localhost:3001 to see your store.
To update to the latest Spree version:
spree update
This pulls the latest Docker image and recreates the containers. The entrypoint automatically runs database migrations.
To pin a specific version, edit SPREE_VERSION_TAG in .env:
SPREE_VERSION_TAG=5.4