// Stay in touch?
Products
Encore CloudEncore Cloud
Encore.tsEncore.ts
Encore.goEncore.go
PricingPricing
Book a DemoBook a Demo
Use Cases
AI-Powered DevelopmentAI-Powered Development
Event-Driven SystemsEvent-Driven Systems
Distributed SystemsDistributed Systems
Case StudiesCase Studies
ShowcaseShowcase
Resources
DocsDocs
InstallInstall
Example AppsExample Apps
Demo videoDemo video
ArticlesArticles
ResourcesResources
GitHub ReleasesGitHub Releases
Systems Operational
Company
About UsAbout Us
Swag ShopSwag Shop
ContactContact
JobsJobs
PressPress
TermsTerms
Privacy PolicyPrivacy Policy
Data Processing AgreementData Processing Agreement
Enterprise SLAEnterprise SLA
Encore
© 2026 EncoreAll rights reserved
© 2026 Encore All Rights Reserved
GitHubDiscordYouTube

Public Object Storage Buckets + R2 Support

Launch Week Day 2

Dec 10, 2024
3 Min Read
Marcus Kohlberg
Dec 10, 2024

Public Object Storage Buckets + R2 Support

Launch Week Day 2

Marcus Kohlberg
3 Min Read

It's Day 2 of Launch Week and we're back with another launch...

Encore.go and Encore.ts now support Public Object Storage Buckets

Today we're launching Public Buckets, an extension of our recently released Object Storage primitive for Encore.go and Encore.ts. This feature simplifies working with public-facing file storage directly in your application code and adds CDN support for optimal content delivery.

How Object Storage works in Encore

Encore lets you integrate infrastructure as type-safe objects in your application code. Whether you're creating a database, a Pub/Sub topic, or an Object Storage bucket, it's as easy as writing a few lines of code.

Example

To create a bucket in Encore.go you define it as a constant within a service:

package user import "encore.dev/storage/objects" var ProfilePictures = objects.NewBucket("profile-pictures", objects.BucketConfig{ Versioned: false, })

That's it! Encore sets up the infrastructure automatically when you run your app locally.

For manual cloud deployments, you just provide a runtime configuration and Encore handles the rest.

Using Public Buckets for simple file sharing

Encore now supports creating public buckets where objects can be accessed directly via HTTP/HTTPS without authentication. This is useful for serving static assets like images, videos, or other public files.

To create a public bucket, set Public: true in the BucketConfig.

Here's how to do it in Encore.go:

var PublicAssets = objects.NewBucket("public-assets", objects.BucketConfig{ Public: true, })

Once configured as public, you can get the public URL for any object using the PublicURL method:

// Get the public URL for an object url := PublicAssets.PublicURL("path/to/image.jpg") // The URL can be used directly or shared publicly fmt.Println(url) // e.g. https://assets.example.com/path/to/image.jpg

For manual cloud deployments, you just need to provide a provide a base url in the runtime configuration, and Encore handles the rest.

When deploying with Encore Cloud it will automatically configure the bucket to be publicly accessible and configure CDN for optimal content delivery, using:

  • Cloud CDN when using Google Cloud
  • AWS CloudFront when using AWS

With Public Buckets, Encore makes managing object storage and public file access simple, powerful, and fully type-safe.

Simple testing in the Development Dashboard

Encore's Development Dashboard makes testing very simple. Call your endpoints, such as the list endpoint, to view and trace requests and get detailed insights. Traces provide insights including file uploads and bucket queries, helping you debug and optimize.

Encore Cloud now supports Cloudflare R2

Encore Cloud now supports Cloudflare R2 as an object storage provider. R2 can often be a cheaper alternative to AWS S3. This is great for anyone looking to save costs on object storage, while getting access to a global CDN.

To use Cloudflare R2, select it on the Create environment page in the Encore Cloud dashboard. If you have an existing environment, contact us to enable it. (Self-serve is coming soon!)

Join the Live stream

Watch today's live stream at 14:00 CET for an in-depth walkthrough and a live Q&A session.

Try it yourself

If you're already using Encore, update using encore version update.

If you're new to Encore, install using the instructions below and then create an example app using encore app create.

macOS
Windows
Linux
Brew
$ brew install encoredev/tap/encore

If you have questions or just want to hang out with other Encore developers, join our community on Discord.

Contents
Encore.go and Encore.ts now support Public Object Storage Buckets
How Object Storage works in Encore
Example
Using Public Buckets for simple file sharing
Simple testing in the Development Dashboard
Encore Cloud now supports Cloudflare R2
Join the Live stream
Try it yourself

A development platform for your own cloud on AWS & GCP

Encore automates infrastructure management, observability, and documentation. Your team can focus on shipping product.

Encore

This blog is presented by Encore, the backend framework for building robust type-safe distributed systems with declarative infrastructure.

Like this article?
Get future ones straight to your mailbox.

You can unsubscribe at any time.

Related Articles

AI
06/03/26 / 7 Min Read
AI
06/03/26 / 7 Min Read
AI agents love type errors
An agent only fixes what it can see before it stops, and a compile error is the one signal that always lands in time.
Ivan Cernja
AI
05/20/26 / 14 Min Read
AI
05/20/26 / 14 Min Read
Are TypeScript backend frameworks ready for AI agents?
We set out to run one benchmark across five TypeScript backend frameworks. Reading the diffs sent us into two more runs, and the picture changed each time.
Ivan Cernja
Infrastructure
05/04/26 / 7 Min Read
Infrastructure
05/04/26 / 7 Min Read
What is distributed tracing?
An interactive guide to debugging real backend issues
Ivan Cernja