---
title: Deploy Twenty CRM with AI
url: "/guides/twenty-crm/"
canonical_url: https://docs.blossom88.com/guides/twenty-crm/
markdown_url: https://docs.blossom88.com/guides/twenty-crm.md
summary: Deploy Twenty CRM with AI on Blossom. Manage contacts, companies, and a sales
  pipeline with managed PostgreSQL, Redis, and files in your private R2 bucket.
categories:
- deployment
- crm
---

# Deploy Twenty CRM with AI

[Twenty](https://twenty.com/) is a CRM for contacts, companies, and sales
opportunities. Keep notes, track follow-ups, and move deals through your
pipeline in one workspace.

Run it on regular App Capacity with managed PostgreSQL, Redis, and files in
your own private S3 or Cloudflare R2 bucket.

[Install the Blossom CLI and skill](/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)](/learn/getting-started/choose-your-cloud/#blossom-byoc).

## Ask Your Agent

> **Ask your AI agent:** Deploy Twenty CRM on Blossom. Help me set up a sales pipeline.

> Follow this guide: https://docs.blossom88.com/guides/twenty-crm/



Your agent checks Twenty's current
[deployment requirements](https://docs.twenty.com/developers/self-host/capabilities/docker-compose),
selects compatible maintained releases, and saves the deployment configuration.

| Part | Purpose |
|---|---|
| Web Service | Serves the CRM interface and APIs |
| Worker Service | Processes background jobs |
| Managed PostgreSQL | Keeps contacts, deals, accounts, and workspace configuration |
| Managed Redis | Coordinates queues and shared caches |
| Your private bucket | Keeps uploaded files and application assets |

Link PostgreSQL and Redis to the Environment. Map the linked database URL to
Twenty's `PG_DATABASE_URL`, and use its required PostgreSQL extensions.
Redis must keep queued jobs without evicting them.

Run database initialization or upgrades and scheduled-job registration **once
in the Release Phase**, before starting the new Services. Require success;
don't let a failed migration become a warning followed by normal startup.
Disable those setup steps in individual web and worker startup commands.

Use the same canonical HTTPS `SERVER_URL`, application secret, and encryption
key for both Services. Keep the keys stable and backed up with the deployment
settings; they protect stored secrets and sessions.

### Connect Your Bucket

Create a private bucket in your own provider account and a bucket-restricted
credential. Supply the bucket, endpoint, region, and credentials through a
private environment file. Keep the provider's administration credentials off
the app.

Select Twenty's S3 storage driver for both web and worker. For temporary
session credentials, leave `STORAGE_S3_ACCESS_KEY_ID` and
`STORAGE_S3_SECRET_ACCESS_KEY` unset. The SDK's default credential chain reads
`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` together.
Keep the normal bucket, region, and endpoint settings configured.

### Create Your Workspace

Keep the site behind **Blossom Account access** while creating its owner and
workspace. Open the generated HTTPS address and complete Twenty's setup.
Use your own owner account and password; don't enable prefilled demo sign-in.

Keep the CRM private unless your use case needs public access. Configure your
email provider before relying on invitations or password resets, and test
delivery to an address you control. Gmail and calendar sync require separate
provider configuration.

## Build Your Sales Pipeline

> **Ask your AI agent:** Help me add a company and contact, create an opportunity, and track the next follow-up.

> Follow this guide: https://docs.blossom88.com/guides/twenty-crm/



Add your first company and contact, create an opportunity, and move it to the
appropriate stage. Add a note or attachment so the next person can pick up
the conversation.
For deal documents, add a **Files** field to Opportunities and upload the
proposal there.

![A sample sales pipeline in Twenty CRM running on Blossom.](/assets/images/guides/twenty-crm/pipeline.png)

![A Twenty opportunity with its contact, proposal file, and follow-up task.](/assets/images/guides/twenty-crm/opportunity.png)

<details class="optional-reading" markdown="1">
<summary>Commands behind the deployment</summary>

Create an App and a prebuilt-image Environment using the compatible Twenty
image selected by your agent:

    blossom app:create --data app.yml
    blossom environment:create --data environment.yml

Create managed data and link it to the Environment:

    blossom database_instance:create --data database_instance.yml --follow
    blossom cache_instance:create --data cache_instance.yml --follow
    blossom environment_link:create --data database-link.yml
    blossom environment_link:create --data redis-link.yml

For PostgreSQL, link the logical Database. For Redis, link the Cache instance:

```yaml
environment_link:
  environment_id: environment-100
  target_type: Database
  target_id: database-100
  var_name: DATABASE_URL
```

Create separate web and worker Services. The web process runs `node dist/main`
on port 3000 with an HTTP readiness check at `/healthz`; the worker runs
`node dist/queue-worker/queue-worker` without a public port. Both map
`DATABASE_URL` to `PG_DATABASE_URL` at startup and use the same image and
private settings.

    blossom service:create --data web-service.yml
    blossom service:create --data worker-service.yml
    blossom env_var:push --environment environment-100 --file .env.production
    blossom environment:deploy_hooks:update --id environment-100 --data hooks.yml
    blossom environment:deploy --id environment-100 --follow

For a generated address, start the private web Service first to obtain its
URL. Save that canonical HTTPS URL for both Services, enable the worker, and
redeploy before creating your workspace or connecting providers. You can also
use your final custom domain.

</details>

## Keep Your CRM Through Updates

> **Ask your AI agent:** Update Twenty and check that my contacts, pipeline, notes, and files are still there.

> Follow this guide: https://docs.blossom88.com/guides/twenty-crm/



Follow Twenty's supported upgrade path, keep a compatible image on web and
worker, and let the Release Phase finish before the new processes start.
Keep PostgreSQL, Redis, bucket settings, and encryption keys consistent.

Configure [database backups](/docs/backups/) and independent bucket
backups. PostgreSQL keeps file metadata; the bucket keeps uploads and
application assets.

### Add Web Containers

Web Containers share PostgreSQL, Redis, and the bucket. Keep the same image,
canonical URL, and keys on every Container, with setup in the Release Phase.
Worker concurrency needs its own workload-specific review.

<details class="optional-reading" markdown="1">
<summary>Scale the web Service</summary>

    blossom service:scale --id service-100 --desired-size 2 --follow

</details>

## What You Get

- Your own private CRM at an HTTPS address
- Contacts, companies, and a sales pipeline in one workspace
- Separate web and worker Services with managed PostgreSQL and Redis
- Uploaded files in your own private S3 or R2 bucket
