---
title: Deploy Pastefy with AI on Blossom
url: "/deploy/pastefy/"
canonical_url: https://blossom88.com/deploy/pastefy/
markdown_url: https://blossom88.com/deploy/pastefy.md
summary: Save code snippets in a private Pastefy workspace with managed MySQL and
  your own login provider.
categories:
- deployment
- developer-tools
stack:
- Java
- Vue
- MySQL
---

# Deploy Pastefy with AI on Blossom

[Pastefy](https://github.com/interaapps/pastefy) is an open-source pastebin
for saving and sharing code or text. Set a paste to **Private** to keep it
visible only to its author.

## Ask Your Agent

> **Ask your AI agent:** Deploy Pastefy privately on Blossom. Help me connect my sign-in provider and save a private snippet.
>
> Follow this guide: https://blossom88.com/deploy/pastefy/

[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 |
|---|---|---|
| Pastefy | Serve the editor and enforce paste visibility | Blossom App Capacity |
| MySQL | Store pastes and account records | Blossom Managed Data |

## Deploy Pastefy

Have an OAuth provider you control ready before you set up private
pastes. Register the callback for your Pastefy HTTPS domain. Keep
Blossom Account access enabled for a private Environment.

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

Use the official image in an x86 Location with port 8080, and link
Blossom Managed MySQL 8.4 as `DATABASE_URL`. The
[tested startup adapter](/deploy/recipes/pastefy/StartPastefy.java)
maps the linked `mysql2://` URL to Pastefy's separate database settings.
Write the Java file in the startup command and run it with the image's
JDK. Set `SERVER_NAME` to the App's HTTPS origin and enable first-run
migrations with `PASTEFY_AUTOMIGRATE`.

For the tested 7.2.7 release, a custom OAuth provider uses
`OAUTH2_OIDC_*` settings and the callback path
`/api/v2/auth/oauth2/oidc/callback`. Use a provider you already trust.
[Pastefy login providers](https://docs.pastefy.app/self-hosting/oauth.html).

</details>

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

    blossom app_plan:preview --data pastefy-plan.yml
    blossom environment_link:create --data pastefy-mysql-link.yml
    blossom service:create --data pastefy-service.yml
    blossom environment:deploy --id environment-100 --follow

</details>

## Save a Private Snippet

Sign in. Paste a short sample, give it a title, select **Private**, and
save it. Keep the returned link so you can reopen the snippet later.

![Choose Private in the Pastefy snippet editor.](/deploy/assets/images/pastefy/pastefy-editor.webp)

> **Ask your AI agent:** Help me save a private sample snippet and check that it opens only for its author.

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



## Reopen It After an Update

Update Pastefy with the same MySQL link. Sign in again and open the
saved snippet.

![Reopen the same snippet after replacing the Container.](/deploy/assets/images/pastefy/pastefy-private-paste.webp)


> **Ask your AI agent:** Update Pastefy and check that I can still open my private snippet.

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



## What You Get

- A private workspace for snippets and workshop notes
- Author-only pastes you can reopen after signing in
- Paste content and user accounts retained in managed MySQL

Tested on Blossom: The same author reopened the same Private paste after replacing the Web Container. A session without the Pastefy login received HTTP 403.
