Skip to main content

Quick Start

The CLI walks you through an interactive setup:
  1. Include Next.js Storefront (default: yes)
  2. Optionally load sample data (products, categories, images)
  3. Optionally start Docker services immediately
Once complete, your store is running at http://localhost:3000 — setup pulls the latest Spree image, seeds the database, and configures API keys, then prints a summary with your admin credentials and keys. If you skipped starting services, the first pnpm dev completes setup automatically. The admin dashboard is included in every project (skip it with --no-dashboard and the API still serves the built-in one at /dashboard). The installer asks whether to add the seller panel — a dedicated panel where marketplace vendors manage their products, orders and settings. Answer yes only if you run a marketplace; you can add it later with spree add seller-dashboard.

Prerequisites

  • Node.js 20 or later
  • Docker (for running the Spree backend, PostgreSQL, and Meilisearch)

CLI Flags

All prompts can be skipped with flags for non-interactive (CI/CD) usage:
The package manager is auto-detected from how you run the command. If you use pnpm dlx create-spree-app, pnpm will be used automatically.
If the default port is already in use, the CLI will automatically find a free port and let you know.

Generated Project Structure

server/ is the only part that is Spree’s. The apps under apps/ are ordinary Vite and Next.js projects you own — restyle, restructure or replace them without forking anything. Each carries its own instructions (server/CLAUDE.md, apps/dashboard/AGENTS.md), which is also what a coding agent reads.

What’s in docker-compose.yml

  • Spree — one web container running the ghcr.io/spree/spree:latest image on the configured port (default 3000); background jobs run in-process via Solid Queue (stored in Postgres — job dashboard at /jobs)
  • PostgreSQL 18 — database with persistent volume
  • Meilisearch — search engine
  • Health checks on postgres, meilisearch, and web

Customizing the Spree API

The server/ directory is the Spree API — a full Rails application with Spree installed (cloned from spree-starter) serving the Store and Admin APIs your storefront and dashboard talk to, plus background jobs and transactional emails. By default, the project runs it from a prebuilt Docker image. To switch to building from your local copy:
This replaces docker-compose.yml with a version that builds from server/, rebuilds the image, and restarts services. You can then:
  • Add gems to server/Gemfile
  • Override models with decorators in server/app/models/
  • Add controllers in server/app/controllers/
  • Configure Spree in server/config/initializers/spree.rb
  • Add migrations with spree generate migration AddFooToSpreeBars foo:string (runs inside the container)
See the Customization Guide for more details.

Spree CLI Commands

The project includes @spree/cli for managing your Spree backend:

After Setup

Admin Dashboard

The dashboard runs as its own dev server: spree dev starts it alongside the API at http://localhost:5173, live-reloading from apps/dashboard/. See the dashboard docs. No default admin account is created. On the first run, spree dev opens a one-time setup link where you create the admin account. If you missed it, print it again with spree rails spree:setup:token.

Store API

The REST API is available at http://localhost:3000/api/v3/store. See the API Reference for details.

Storefront

If you included the storefront, start it in a separate terminal:
Open http://localhost:3001 to see your store.

Updating Spree

To update to the latest Spree version:
This updates the server (the Docker image, or the Spree gems on an ejected project) and the @spree/* packages of the project and its dashboard apps, then runs database migrations and data backfills. See spree upgrade for details. To pin a specific version, edit SPREE_VERSION_TAG in .env:

Deployment

The project deploys as one image: server/Dockerfile builds the Spree API together with your Admin Dashboard (when apps/dashboard exists), served same-origin at /dashboard — no CORS, no cookie configuration, no second service.
  • Render — the render.yaml at the project root is a ready Blueprint: one Docker service built straight from your repo, migrations run on boot.
  • Anywhere else — spree build --production builds the same image locally; push it to a registry and run it on any Docker host.
See the Deployment Guide and the dashboard deployment docs.

Next Steps

Next.js Storefront

Customize and extend the Storefront

Spree SDK

TypeScript SDK for the Store and Admin APIs

API Reference

Explore the REST API endpoints

Core Concepts

Learn about Spree’s architecture