---
title: Deploy Bullet Train with AI on Blossom
url: "/deploy/bullet-train/"
canonical_url: https://blossom88.com/deploy/bullet-train/
markdown_url: https://blossom88.com/deploy/bullet-train.md
summary: Start a Rails SaaS with Bullet Train, managed PostgreSQL, and Redis. Sign
  up and open your first team dashboard.
categories:
- deployment
- rails
- saas
stack:
- Ruby
- Ruby on Rails
- Puma
- Sidekiq
- PostgreSQL
- Redis
---

# Deploy Bullet Train with AI on Blossom

[Bullet Train](https://bullettrain.co/) is a Ruby on Rails framework
for SaaS apps. Its open-source starter includes accounts, teams, and
a dashboard. Deploy it, create your first team, and receive its
welcome email.

![Open the Bullet Train signup page.](/deploy/assets/images/bullet-train/signup.webp)

## Ask Your Agent

> **Ask your AI agent:** Deploy my Bullet Train app on Blossom and help me create my first team.
>
> Follow this guide: https://blossom88.com/deploy/bullet-train/

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

## Have Ready

- **Bullet Train repository** (Required): Use your app repository or fork the open-source Bullet Train starter.
- **Email delivery** (Required): Use a private test inbox for the first welcome email. Set up an SMTP provider before sending mail to customers.

## How It Runs

| Part | Role | Where |
|---|---|---|
| Rails and Puma | Serve the app and its compiled assets | HTTPS Service on App Capacity |
| Sidekiq | Run background work such as email delivery | Private Service on App Capacity |
| PostgreSQL | Store user accounts and teams | Blossom Managed PostgreSQL |
| Redis | Keep Sidekiq’s job queue | Blossom Managed Redis |

## Deploy Bullet Train

Start from your own repository or the [Bullet Train starter](https://github.com/bullet-train-co/bullet_train).
Use its Dockerfile. Connect managed PostgreSQL and Redis, and run
Puma and Sidekiq as separate Services.

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

- Set the Dockerfile build variable `BULLET_TRAIN_VERSION` to the
  version pinned in the repository’s Gemfile. Use the repository
  root as the build context.
- Link PostgreSQL as `DATABASE_URL` and Redis as `REDIS_URL`.
  Run `./bin/rails db:migrate && ./bin/rails db:seed` in the Release
  Phase before Puma and Sidekiq start.
- Set `RAILS_ENV=production`, `RAILS_SERVE_STATIC_FILES=1`, and a
  stable private `SECRET_KEY_BASE`. Use the final HTTPS address as
  `BASE_URL`.
- Start `bundle exec puma -p 3000 -e production` on port 3000 and
  `bundle exec sidekiq -t 25` on a separate, private Service. Use a
  TCP readiness probe for the web Service.
- For a workshop, point the `MAILGUN_SMTP_*` variables at a private
  Mailpit Service. Keep Mailpit’s web inbox and your demo behind
  Blossom Account access.

</details>

## Create Your First Team

Open the signup form and create a test account. Enter your name and
team name to open the dashboard. Check your inbox for the welcome
message.

> **Ask your AI agent:** Help me sign up for my Bullet Train app and create a team called Workshop Test Team.

> Follow this guide: https://blossom88.com/deploy/bullet-train/



## Keep It Running

Open your team dashboard from a fresh sign-in after replacing the web
Container. The team and its members are stored in PostgreSQL.

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

    blossom service:scale --id service-web-100 --desired-size 0 --follow
    blossom service:scale --id service-web-100 --desired-size 1 --follow

</details>

![Reopen the team dashboard after replacing the web Container.](/deploy/assets/images/bullet-train/team-after-replacement.webp)

## What You Get

- A Rails app at an HTTPS address
- A user account and team dashboard
- A welcome email delivered by a Sidekiq worker
- The same team after a web Container replacement

Tested on Blossom: A fresh sign-in reopened the same team dashboard after replacing the web Container.
