Deploy Garage S3 Storage
Ultra-light S3 server: fast, open-source, plug-and-play 🚀
Garage S3
Just deployed
/data
Deploy and Host Garage S3 Storage on Railway
Garage is an ultra-lightweight, open-source distributed object storage service tailored for self-hosting. It implements the Amazon S3 API, allowing seamless integration with existing tools and SDKs. Written in Rust, it is designed for extremely low resource consumption, making it ideal for cost-effective cloud deployments and resource-constrained environments.
About Hosting Garage S3 Storage
Hosting Garage S3 Storage on Railway provides a zero-configuration, plug-and-play experience for robust object storage. This template utilizes a lightweight Alpine Linux Docker image running the official compiled Garage binary. It automatically provisions a persistent Railway Volume mounted at /data to ensure your metadata and files survive container restarts.
On its first boot, a custom shell script automatically initializes the cluster topology, assigns the node capacity, creates your primary bucket, and generates secure access keys based on your environment variables. Railway automatically exposes the S3 API via an HTTP proxy, meaning your storage is immediately ready to accept API requests from any application.
Common Use Cases
- Storing user-uploaded media (images, documents, videos) for web frameworks like Django, Express, or Laravel.
- Hosting static assets or creating cost-effective, self-hosted backups for your databases and applications.
- Replacing heavy storage backends like MinIO or AWS S3 in resource-constrained environments to save RAM and CPU.
Dependencies for Garage S3 Storage Hosting
- Persistent Volume: A Railway volume mounted at
/datato persistently store chunks and metadata. - Environment Variables:
GARAGE_BUCKET,GARAGE_KEY_NAME,GARAGE_ACCESS_KEY, andGARAGE_SECRET_KEYfor auto-initialization.
Deployment Dependencies
Implementation Details
Since Railway does not support wildcard subdomains (e.g., my-bucket.domain.com), you must configure your S3 clients to use Path-Style Addressing.
Example: Connecting with Python (Boto3)
import boto3
from botocore.client import Config
s3 = boto3.client(
's3',
endpoint_url='https://',
aws_access_key_id='',
aws_secret_access_key='',
region_name='garage',
# Mandatory configuration for Railway deployments:
config=Config(signature_version='s3v4', s3={'addressing_style': 'path'})
)
xample: Connecting with Django (django-storages)
# settings.py
AWS_S3_ENDPOINT_URL = 'https://'
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
AWS_STORAGE_BUCKET_NAME = ''
AWS_S3_REGION_NAME = 'garage'
# Mandatory configuration for Railway deployments:
AWS_S3_ADDRESSING_STYLE = 'path'
## Why Deploy
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 Garage S3 Storage 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
Garage S3
matheusac19/railway_garage_templateGARAGE_ACCESS_KEY
(Recommended) Create your S3 Access Key ID. It MUST start with 'GK' (Ex: GKmyproject123). If left blank, a secure key will be generated in the logs of the first deployment.
GARAGE_SECRET_KEY
(Recommended) Create your S3 Secret Key. It must be EXACTLY 64 hexadecimal characters (letters a-f, numbers 0-9). If left blank, one will be automatically generated in the logs.