Deploy Public Bucket Image Proxy

Public proxy for images in a bucket, with image optimization using imgproxy

Deploy Public Bucket Image Proxy

public imgproxy

imgproxy/imgproxy:v3

Just deployed

raw images

Bucket

Just deployed

Deploy and Host Public Bucket Image Proxy on Railway

A lightweight, high-performance image proxy that publicly serves images from a private bucket. It dynamically resizes and optimizes images on the fly using imgproxy, reducing bandwidth and improving load times without exposing your storage endpoints.

About Hosting Public Bucket Image Proxy

Deploy a production-ready instance with zero configuration. It connects seamlessly to an S3-compatible Railway Bucket, giving you on-demand image transformations via simple URL parameters. Once deployed, it automatically handles proxying, optimizing and delivering images for websites, applications, and APIs. imgproxy is lightweight and resource-efficient, so it doesn't cost a lot to host on Railway.

Common Use Cases

  • Serving User Uploads: Upload user-generated images to the bucket and serve optimized versions to users
  • Optimizing images for blogs and websites: Upload images for your blog or website to the bucket, and serve optimized versions to users

Dependencies for Public Bucket Image Proxy Hosting

The template includes the S3-compatible bucket and the public imgproxy which optimizes the images on the fly.

Deployment Dependencies

Implementation Details

Upload images

Upload images into your bucket from your code with any S3-compatible library, or from a desktop app. For example:

Serve optimized images publicly

Once an image is uploaded into the bucket, you can publicly access an optimized version by constructing a URL like this:

https://img.example.com/unsafe/q:80/w:1080/plain/s3://YOUR_BUCKET_NAME/duck.png
  • https://img.example.com – use a railway.app domain or a custom domain. A custom domain allows you to use caching with a CDN
  • unsafe – because it's publicly accessible, not a temporary signed URLs
  • q:80 – for quality of the optimized image, in this example 80. a number between 0 and 100
  • w:1080 – for a width of the resulting image, in this example 1080px
  • plain – indicates that a plain URL will follow
  • s3://YOUR_BUCKET_NAME – replace with the Railway Bucket's "Bucket Name" in the Credentials Tab (or use the BUCKET variable of the Railway Bucket)
  • duck.png – the path to your file

imgproxy supports many more URL parameters.

(optional) Save bandwidth by adding a CDN

Add a custom domain to the imgproxy service, and use a DNS with a CDN Proxy like Cloudflare's "orange cloud". The CDN will cache the optimized images, so once the image is cached by the CDN, the cached version will be returned and the traffic doesn't even hit your service anymore.

When using Cloudflare, enable Tiered Cache for even more cache hits.

License

The open source version of imgproxy is licensed under MIT

Why Deploy Public Bucket Image Proxy 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 Image Proxy 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

raw images

Bucket

More templates in this category

View Template
Postgres-to-R2 Backup
Auto back up PostgreSQL databases to Cloudflare R2 with optional encryption

View Template
ReadySet
A lightweight caching engine for Postgres

View Template
Simple S3
Deploy a S3-compatible storage service with a pre-named bucket.