---
title: Deploy Label Studio with AI on Blossom
url: "/deploy/label-studio/"
canonical_url: https://blossom88.com/deploy/label-studio/
markdown_url: https://blossom88.com/deploy/label-studio.md
summary: Run Label Studio on Blossom with managed PostgreSQL, label a text sample,
  and export its annotation as JSON.
categories:
- deployment
- data-labeling
- developer-tools
stack:
- Python
- Django
- React
- PostgreSQL
---

# Deploy Label Studio with AI on Blossom

[Label Studio](https://labelstud.io/) lets you label text, images, and other
data for training and evaluating models. This recipe uses Community Edition.

![A synthetic text labeling project in Label Studio.](/deploy/assets/images/label-studio/text-project.webp)

## Ask Your Agent

> **Ask your AI agent:** Deploy Label Studio on Blossom and help me label and export a sample text dataset.
>
> Follow this guide: https://blossom88.com/deploy/label-studio/

[Install the Blossom CLI and skill](https://docs.blossom88.com/learn/getting-started/install/) on your agent's machine and choose a Blossom Cloud Location when you log in. You can also use [Blossom BYOC (bring your own cloud)](https://docs.blossom88.com/learn/getting-started/choose-your-cloud/#blossom-byoc).

## Label a Text Sample

Create a text classification project, import a few sample rows, and add a
label. Export the project as JSON to see the original text and annotation
in the same file.

<details class="optional-reading" markdown="1">
<summary>Deployment setup and commands</summary>

Use the [official Label Studio image](https://labelstud.io/guide/install.html)
on port 8080. Link [managed PostgreSQL](https://docs.blossom88.com/docs/data/)
as `DATABASE_URL`. The [startup script](/deploy/recipes/label-studio/start-web.py)
runs with `python3` as the web Service entrypoint and maps the database link
to the `POSTGRE_*` variables in the
[upstream database setup](https://labelstud.io/guide/storedata.html#PostgreSQL-database).
Keep the workspace private with Blossom Account access. Set a stable Django
`SECRET_KEY` and set `LABEL_STUDIO_CSRF_TRUSTED_ORIGINS` to the exact HTTPS
origin. To set up the first account, provide `LABEL_STUDIO_USERNAME` and a
private `LABEL_STUDIO_PASSWORD`.

The inline text example stores tasks and annotations in PostgreSQL. Set up
[persistent storage](https://labelstud.io/guide/persistent_storage.html) if
people will upload files that need to survive a Container replacement.

    blossom profile:show
    blossom app:create --data app.yml
    blossom environment:create --data environment.yml
    blossom database_instance:create --data postgres.yml
    blossom environment_link:create --data database-link.yml
    blossom service:create --data web.yml
    blossom env_var:push --environment environment-100 --file .env.production
    blossom environment:deploy --id environment-100 --follow

</details>

## What You Get

- A private workspace for labeling text, images, and other data
- Text tasks and annotations stored in managed PostgreSQL
