---
title: Deploy Spree with AI on Blossom
url: "/deploy/spree/"
canonical_url: https://blossom88.com/deploy/spree/
markdown_url: https://blossom88.com/deploy/spree.md
summary: Set up Spree Community Edition, publish a product and complete one offline
  order through the Store API.
categories:
- deployment
- commerce
stack:
- Ruby
- Rails
- PostgreSQL
---

# Deploy Spree with AI on Blossom

[Spree Community Edition](https://github.com/spree/spree) gives you a
commerce dashboard and APIs for products, stock and orders. Publish one
product on the default sales channel and try checkout over the Store API.

## Ask Your Agent

> **Ask your AI agent:** Deploy Spree Community Edition on Blossom with managed PostgreSQL. Help me publish a product and place a test order.
>
> Follow this guide: https://blossom88.com/deploy/spree/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and [choose a Location in your cloud account](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#connect-your-provider).

## How It Runs

| Part | Role | Where |
|---|---|---|
| Spree Community Edition | Serve the dashboard and APIs, with Solid Queue jobs in Puma | Web Service with Blossom Account access |
| PostgreSQL | Store the catalog, orders, and queued jobs | Blossom Managed Data |

## Deploy Spree Community Edition

Run the official Spree image with managed PostgreSQL. Enable Blossom
Account access and open `/dashboard` when the Service is ready.

<details class="optional-reading" markdown="1">
<summary>Notes for your agent</summary>

Use the [Spree Community Edition image](https://github.com/spree/spree/blob/v6.0.6/docs/developer/deployment/docker.mdx)
and [BSD 3-Clause release](https://github.com/spree/spree/blob/v6.0.6/LICENSE).
The pinned image is
`ghcr.io/spree/spree:6.0.6@sha256:08f044e2d10937e6a9a5c4b4ef427b07d3981709f3addc453d22d8e56934ab6c`.
Use port 3000 and a readiness check on `/up`. The
[startup wrapper](/deploy/recipes/spree/start-on-launcher.sh) sets
`SPREE_HOST` from Blossom's generated HTTPS Service URL and runs the
official entrypoint, which applies migrations on startup.

Link Managed PostgreSQL 18 as `DATABASE_URL`. Keep `SECRET_KEY_BASE`
and the three `ACTIVE_RECORD_ENCRYPTION_*` settings stable. Use
`RAILS_FORCE_SSL=true`, `RAILS_ASSUME_SSL=true` and `SOLID_QUEUE_IN_PUMA=true`.
This recipe uses the dashboard and Store API. Set up shared media storage
before adding product uploads you want to keep across updates.

</details>

<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom app_plan:preview --data spree-plan.yml
    blossom database_instance:create --data spree-postgres.yml
    blossom app:create --data spree-app.yml
    blossom environment:create --data spree-environment.yml
    blossom environment_link:create --data spree-postgres-link.yml
    blossom env_var:push --environment environment-100 --file spree.env
    blossom service:create --data spree-web.yml
    blossom environment:deploy --id environment-100 --follow

</details>

## Set Up the Owner and a Product

Finish the private setup for the store owner. Add a sample pencil case
with a price and tracked stock, and publish it on the default channel.

> **Ask your AI agent:** Set up my private Spree owner and publish a sample pencil case with a USD price and tracked stock.

> Follow this guide: https://blossom88.com/deploy/spree/



## Complete One Offline Checkout

Use the Store API to place a guest order with one pencil case, delivery,
and the offline **Check** method. Retry completion for that same order.
Find one completed order for the SKU in the dashboard.

![Find the published pencil case SKU in the dashboard.](/deploy/assets/images/spree/spree-pencil-case.webp)

> **Ask your AI agent:** Place a guest order for the pencil case through the Store API with offline Check, then retry completion for the same order.

> Follow this guide: https://blossom88.com/deploy/spree/



## Keep It Running

![Reopen the same offline test order.](/deploy/assets/images/spree/spree-test-order.webp)


Replace the demo Container with the same PostgreSQL Link. Sign in to
the dashboard again and reopen the pencil case and original order.

> **Ask your AI agent:** Replace the Spree demo Container and reopen the same product and order in the dashboard.

> Follow this guide: https://blossom88.com/deploy/spree/



<details class="optional-reading" markdown="1">
<summary>Commands your agent runs</summary>

    blossom service:scale --id service-100 --desired-size 0 --follow
    blossom service:scale --id service-100 --desired-size 1 --follow
    blossom container:list --service service-100

</details>

## What You Get

- A private Spree dashboard and Store API
- One product with a tracked SKU, stock and a USD price
- A completed offline test order
- A product and order you can reopen after a deployment

Tested on Blossom: Retrying Store API completion returned the same order. A fresh dashboard sign-in reopened it after Container replacement.
