---
title: Deploy SurrealDB with AI on Blossom
url: "/deploy/surrealdb/"
canonical_url: https://blossom88.com/deploy/surrealdb/
markdown_url: https://blossom88.com/deploy/surrealdb.md
summary: Run SurrealDB privately, query a checklist as a read-only user, and keep
  the records through an update.
categories:
- deployment
- databases
stack:
- Rust
- SurrealQL
---

# Deploy SurrealDB with AI on Blossom

[SurrealDB](https://github.com/surrealdb/surrealdb) is a database that
supports document and graph data. Its query language is SurrealQL.

## Ask Your Agent

> **Ask your AI agent:** Deploy SurrealDB on Blossom and help me query a sample checklist as a read-only user.
>
> Follow this guide: https://blossom88.com/deploy/surrealdb/

[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 |
|---|---|---|
| SurrealDB | Store and query checklist records | Private Persistent Service |
| Client | Run queries as an administrator or a database viewer | Blossom Job |

## Deploy SurrealDB

Use the [official Container image](https://surrealdb.com/docs/running/docker)
with SurrealKV and a [Persistent Service Volume](/docs/apps/persistent-services/).
Keep the database private. This setup is for your own team's use under the
[SurrealDB license](https://github.com/surrealdb/surrealdb/blob/v4.0.1/LICENSE).

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

Run one Container, mount a Volume at `/data`, and start SurrealDB with
`start surrealkv:/data/workshop.db`. Use a TCP health check on port
`8000`. Set the initial administrator identity and password through
`SURREAL_USER` and `SURREAL_PASS` in Blossom Variables and Links.

    blossom environment:deploy --id environment-100 --follow

</details>

## Query a Checklist as a Viewer

Create a namespace, database, and two checklist records. Give a user the
database-level `VIEWER` role and confirm that they can read the list.
Try updating one item as that user, then query it again to check that
the original value stayed in place.

> **Ask your AI agent:** Help me create a sample checklist and check that a database viewer can read it without changing it.

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



![Read two checklist records as a database viewer.](/deploy/assets/images/surrealdb/scoped-checklist-query.webp)

## Reopen the Checklist After an Update

Replace the database Container and query the checklist again as the same
viewer.

> **Ask your AI agent:** Replace the SurrealDB Container and check that the same viewer can read both records.

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



![Read the same records after replacing the Container.](/deploy/assets/images/surrealdb/checklist-after-replacement.webp)

## What You Get

A private SurrealDB instance with a persistent checklist and a scoped
account for read-only queries.

## What You Get

- A private, file-backed SurrealDB instance
- A sample checklist with read-only access
- The same records after replacing the database Container

Tested on Blossom: A database viewer read the same two records after replacement and could not change them.
