Blossom Logo Deploy your apps with Blossom — Get Started
BoltOps Blog

Build a Content API with Strapi and Private R2 Storage

Give your team a content editor and your application an API. We deployed Strapi with managed PostgreSQL and private R2 media, then checked publication, API permissions, and Container replacement.

A published article in Strapi Content Manager running on Blossom.
A small CMS with a published article and a restricted content API.

Strapi is a headless CMS. Your team edits content in Strapi Admin, and your website or application reads that content through an API. You define the fields instead of working around a fixed page format.

It’s built with Node.js and TypeScript, with a React Admin interface. Our setup uses PostgreSQL. The source is on GitHub.

We deployed it on Blossom with this prompt:

Ask your AI agent

Deploy Strapi on Blossom with managed Postgres and R2 uploads. Help me publish an article through the API.

Deployment guide

Build the CMS You Need

Strapi is a project you extend. The content model and plugins belong in your source repository. Blossom builds that project, including the Admin interface, and runs it as a web Service.

Our example project has an Article with a title, slug, body, and cover image. It’s a useful starting point without making the setup complicated.

Part What it does
Web Service Strapi Admin and content API
Managed PostgreSQL Content, administrators, permissions, and media records
Private R2 bucket Uploaded files

The web Container runs on regular App Capacity. There isn’t a local uploads Volume to keep. Changes to the model go through Git and a rebuild; changes to an article go through the editor and into PostgreSQL.

Publish Something, Then Read It

We created the owner, uploaded a cover image, and saved an article as a draft. The published-content API didn’t return it yet. After publication, it did.

We gave the API token permission to read articles. It could read the article, but couldn’t create one. An unauthenticated request was refused too.

Those checks matter. A working API should return the content you intended to share and enforce the permissions you chose.

A File Record Isn’t the File

The media record is in PostgreSQL. The actual file is in R2. We checked both.

Strapi Media Library with an uploaded cover image served from a private R2 bucket.

The first browser preview caught a small setup detail: Strapi requests the image with CORS. A signed download worked, but the browser couldn’t display it until the bucket allowed reads from our Strapi address. The bucket stayed private. That step is now in the guide.

Private media links expire. In the release we tested, both Admin and the authorized Content API returned signed links. Refresh those links rather than saving them as permanent addresses. For public website images, deliberately configure a separate bucket for public delivery.

Replace the Container

After replacing the web Container, the published article and its API token still worked. The stored cover image had the same bytes. A fresh owner login and a new upload worked too.

Strapi had optimized the original PNG when we uploaded it, so we compared the stored file before and after replacement. Comparing it directly with the source PNG would have confused normal image processing with lost data.

We tested one web Container. Check the requirements of your plugins and jobs before adding replicas. Configure email for invitations and password resets, and keep the database, bucket, and application secrets stable through updates.

Follow the Strapi deployment guide and build your content API on Blossom.

Tip: Use ← → arrow keys to navigate between pages

Join a group of good-looking folks who get free email updates from BoltOps.