---
title: Deploy Logto with AI on Blossom
url: "/deploy/logto/"
canonical_url: https://blossom88.com/deploy/logto/
markdown_url: https://blossom88.com/deploy/logto.md
summary: Deploy Logto with AI on Blossom. Preview app sign-in on an HTTPS endpoint
  and store your identities in PostgreSQL.
categories:
- deployment
- identity
stack:
- TypeScript
- Node.js
- PostgreSQL
---

# Deploy Logto with AI on Blossom

[Logto](https://logto.io/) gives an app user accounts, sign-up and sign-in.
Try the sign-in experience in a browser before connecting your app.

| Part | Purpose |
|---|---|
| Logto | Runs the public OpenID Connect issuer and native sign-in experience |
| Admin proxy | Serves the Console on its own HTTPS URL behind Blossom Account access |
| Private PostgreSQL | Stores Logto's configuration and identities on a Persistent Volume |

![The Logto Live Preview confirms sign-in and displays the sample account.](/deploy/assets/images/logto/live-preview.webp)

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

Use the [self-hosted edition](https://docs.logto.io/logto-oss/get-started-with-oss).
Pin compatible official images for Logto, PostgreSQL and Caddy.
Place the three Services in the same Environment so they can use private
Service addresses. Keep PostgreSQL private and attach one Volume to its
[Persistent Service](/docs/apps/persistent-services/).

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

Give Logto a non-superuser role that owns its database and can create
PostgreSQL roles for its bootstrap. That operation requires a private database with an
appropriate owner. Set `DB_URL` through runtime variables and use the
Release Phase to seed once. Keep database administration credentials
private and remove bootstrap values from the runtime after initialization.

Run Logto on port `3001`. Use the HTTPS Service URL for `ENDPOINT`.
Proxy the admin Service to Logto's private listener on `3002`. Set
`ADMIN_ENDPOINT` to the admin Service URL and `TRUST_PROXY_HEADER=1`
for incoming HTTPS proxy traffic. Publish the proxy first with the Logto
Service disabled. Use the proxy's URL, then enable Logto for the next
deploy. Use the Logto image as the Environment image for the seed hook
and pin the images on PostgreSQL and Caddy separately.

Set Blossom Account access on the Environment. For the tested username
and password flow, allow the public OIDC, sign-in, registration, consent
and UI asset paths. Live Preview needs its demo routes as well. Keep
`/console` and management API routes behind the gate.

    blossom service:create --data logto.yml
    blossom service:create --data admin.yml
    blossom environment:deploy_hooks:update --id environment-100 --data deploy-hooks.yml
    blossom environment:deploy --id environment-100 --follow

Run `npm run cli db seed -- --swe` as the initial Release Phase command,
then disable the hook once it succeeds. Keep the HTTPS URLs and
database Volume stable during updates. PostgreSQL has one active Container,
so plan for a brief interruption when replacing it.

</details>

## Ask Your Agent

> **Ask your AI agent:** Deploy Logto on Blossom and help me test sign-in for my app.
>
> Follow this guide: https://blossom88.com/deploy/logto/

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

## What You Get

- An HTTPS endpoint for app sign-in
- An admin console protected by Blossom Account access
- Identities kept in PostgreSQL on a Persistent Volume
