---
title: Deploy OpenCart with AI on Blossom
url: "/deploy/opencart/"
canonical_url: https://blossom88.com/deploy/opencart/
markdown_url: https://blossom88.com/deploy/opencart.md
summary: Set up a private OpenCart store, add a product with a photo and reopen a
  saved cart after an update.
categories:
- deployment
- commerce
stack:
- PHP
- Twig
- Apache
- MySQL
---

# Deploy OpenCart with AI on Blossom

[OpenCart](https://www.opencart.com/) is a storefront and admin area for
managing products and customer orders. Add one product and use it to see
what a shopper will find in the catalog and cart.

## Ask Your Agent

> **Ask your AI agent:** Deploy OpenCart on Blossom with managed MySQL. Help me add a product and save a sample cart.
>
> Follow this guide: https://blossom88.com/deploy/opencart/

[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).

## Have Ready

- **Managed MySQL** (Required): Use an empty MySQL 8.4 database for the first installation.

## How It Runs

| Part | Role | Where |
|---|---|---|
| OpenCart | Serve the shop and keep installation settings, product images, and private storage on a Volume | Persistent Service with Blossom Account access |
| MySQL | Store the catalog, customer records, and carts | Blossom Managed Data |

## Deploy OpenCart

Build the OpenCart 3 package with PHP and Apache. Link managed MySQL,
mount a Volume for the store's settings and images, and enable Blossom
Account access for the demo.

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

Use the installable ZIP from the [OpenCart 3.0.5.1 release](https://github.com/opencart/opencart/releases/tag/3.0.5.1).
Build the [recipe Dockerfile](/deploy/recipes/opencart/Dockerfile) with
the ZIP named `opencart-3.0.5.1.zip` and the companion
[settings helper](/deploy/recipes/opencart/configure-release.php),
[Apache configuration](/deploy/recipes/opencart/opencart-apache.conf) and
[startup script](/deploy/recipes/opencart/start-opencart.sh).
The build checks the archive and configures the MySQL connection for
`utf8mb4` so it matches the schema.

Route port 80 to the app and use a TCP health check. Mount the Volume at
`/var/lib/opencart`. Link managed MySQL 8.4 as `OPENCART_MYSQL_URL`.
Use the image's startup script to initialize the mounted directories.

</details>

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

    blossom app_plan:preview --data opencart-plan.yml
    blossom database_instance:create --data opencart-mysql.yml
    blossom app:create --data opencart-app.yml
    blossom environment:create --data opencart-environment.yml
    blossom environment_link:create --data opencart-mysql-link.yml
    blossom service:create --data opencart-web.yml
    blossom environment:deploy --id environment-100 --follow

</details>

## Finish the Private Installer

Open `/install/` and install into the linked database using its scoped
credentials. Sign in to the admin area. Close the installer when both the
shop and admin configurations have been saved.

> **Ask your AI agent:** Finish the private OpenCart installer with my MySQL Link, check the admin sign-in, and close the installer.

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



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

    blossom shell --service service-100 -- touch /var/lib/opencart/installed

The image uses this marker to close `/install/`. Apache also keeps the
private application storage out of the web routes.

</details>

## Add One Product to a Cart

Add **Harbor Workshop Compass 🧭** with a product image and inventory.
Find it by name, add one to a guest cart, and keep that browser session
for the next step.

![Find the sample compass in the storefront.](/deploy/assets/images/opencart/opencart-product.webp)

> **Ask your AI agent:** Add a sample compass with a photo, search for it in the shop, and save a cart with one compass.

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



## Keep It Running

![Reopen the original guest cart after the update.](/deploy/assets/images/opencart/opencart-cart.webp)


Replace the demo Container with the same Volume and MySQL Link. Reopen
the guest cart in the original browser session and check the product image.

> **Ask your AI agent:** Replace the OpenCart demo Container, then reopen the same cart and verify the product image.

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



<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 storefront and admin area
- A searchable product with a photo
- A sample cart you can reopen after an update
- A store that keeps its installed configuration across replacements

Tested on Blossom: With the existing guest session, the replacement Container served the same cart and a byte-identical product image.
