Deploy Public Bucket URLs
Get public bucket URLs and serve files with free egress
s3-public-presigner
Just deployed
public files
Bucket
Just deployed
Deploy and Host Public Bucket URLs on Railway
Serve files from Railway Buckets using public, static URLs without a proxy. The service redirects to a presigned bucket URL, which then delivers the file to the user. This avoids paying for public egress when serving the file.
Demo
https://bucket-public-presigner-demo.up.railway.app/duck.png
Open the link to view the file. Your browser will redirect to another URL: a presigned URL that grants temporary access to the object in your bucket. While this temporary URL will expire (by default after 1 hour), the original public URL will never expire.
About Hosting Public Bucket URLs
Presigned URLs are temporary, signed URLs that grant time-limited access to specific objects in your bucket. This template generates them automatically and redirects requests to them. Users typically don't notice that the URL changed.
With S3-style storage, it’s common to use static URLs that perform an authorization check before redirecting to a presigned URL. This template skips the authentication and redirects to the file immediately.
Caution: Only use this template if every file in your bucket should be publicly accessible. If you need private files, use separate buckets or implement your own authenticated redirects. For an example implementation, check out the source code of this template: https://github.com/timomeh/s3-public-presigner
Common Use Cases
- Serve public static files from a Railway Bucket
- Share files via public links
- Embed images or other assets using stable URLs
Dependencies for Public Bucket URLs Hosting
There are no external dependencies. The template automatically provisions a Railway Bucket.
If you already have a bucket you want to expose publicly, update the variable references to point to your existing bucket.
Deployment Dependencies
- Railway Buckets
- This template uses a lightweight Bun server: https://github.com/timomeh/s3-public-presigner
Why Deploy Public Bucket URLs on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Public Bucket URLs on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
s3-public-presigner
timomeh/s3-public-presignerpublic files
Bucket