Simple step-by-step guide to deploy FileVault on Railway.
- Railway Account - Sign up at railway.app
- GitHub Repository - Push your FileVault code to GitHub
- Clerk Account - For authentication (clerk.com)
Railway Services:
├── Frontend (React + Nginx)
├── Backend (Go API)
├── PostgreSQL (Database)
└── MinIO (File Storage)
- Go to railway.app and create a new project
- Connect your GitHub repository
- Deploy services in this order:
- Click "+ New" → "Database" → "PostgreSQL"
- Wait for deployment to complete
- Click "+ New" → "Empty Service"
- Name it
minio - Go to Settings → Variables and add:
MINIO_ROOT_USER=minioadmin MINIO_ROOT_PASSWORD=your_secure_password_123 - Go to Settings → Deploy and set:
- Image:
minio/minio:latest - Start Command:
server /data --console-address ':9001'
- Image:
- Go to Settings → Networking and enable public networking
- Deploy the service
- Click "+ New" → "GitHub Repo" → Select your repository
- Set Root Directory:
/Backend - Go to Settings → Variables and add:
DATABASE_URL=${{Postgres.DATABASE_URL}} PORT=8080 GIN_MODE=release CLERK_SECRET_KEY=sk_live_your_clerk_secret_key MINIO_ENDPOINT=${{minio.RAILWAY_PRIVATE_DOMAIN}}:9000 MINIO_ACCESS_KEY=${{minio.MINIO_ROOT_USER}} MINIO_SECRET_KEY=${{minio.MINIO_ROOT_PASSWORD}} MINIO_BUCKET=files MINIO_USE_SSL=false - Go to Settings → Networking and enable public networking
- Deploy the service
- Click "+ New" → "GitHub Repo" → Select your repository
- Set Root Directory:
/Frontend - Go to Settings → Variables and add:
VITE_API_URL=https://${{backend.RAILWAY_PUBLIC_DOMAIN}}/api/v1 VITE_CLERK_PUBLISHABLE_KEY=pk_live_your_clerk_publishable_key - Go to Settings → Networking and enable public networking
- Deploy the service
After all services are running:
-
Install MinIO Client (mc):
- Windows: Download from https://dl.min.io/client/mc/release/windows-amd64/mc.exe
- macOS:
brew install minio/stable/mc - Linux:
wget https://dl.min.io/client/mc/release/linux-amd64/mc && chmod +x mc
-
Set up MinIO alias and bucket:
# Replace YOUR_MINIO_URL with your Railway MinIO service URL mc alias set myminio YOUR_MINIO_URL MINIO_ROOT_USER MINIO_ROOT_PASSWORD # Create bucket (if not exists) mc mb myminio/files --ignore-existing # Apply bucket policy for public tagged objects mc anonymous set-json bucket-policy.json myminio/files
-
Alternative: Web Console Setup:
- Go to your MinIO service URL (from Railway dashboard)
- Login with your MINIO_ROOT_USER and MINIO_ROOT_PASSWORD
- Create a bucket named
files - Manually set bucket policy to public read for tagged objects
DATABASE_URL=${{Postgres.DATABASE_URL}}
PORT=8080
GIN_MODE=release
CLERK_SECRET_KEY=sk_live_your_secret_key
MINIO_ENDPOINT=${{minio.RAILWAY_PRIVATE_DOMAIN}}:9000
MINIO_ACCESS_KEY=${{minio.MINIO_ROOT_USER}}
MINIO_SECRET_KEY=${{minio.MINIO_ROOT_PASSWORD}}
MINIO_BUCKET=files
MINIO_USE_SSL=falseVITE_API_URL=https://${{backend.RAILWAY_PUBLIC_DOMAIN}}/api/v1
VITE_CLERK_PUBLISHABLE_KEY=pk_live_your_publishable_keyMINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=your_secure_password_123- Backend Health: Visit
https://your-backend.up.railway.app/health - Frontend: Visit your frontend URL from Railway dashboard
- Upload Test: Try uploading a file through the frontend
Database Connection Errors:
- Verify
DATABASE_URLis correctly set - Check PostgreSQL service is running
MinIO Connection Errors:
- Ensure MinIO service is running and accessible
- Verify
MINIO_ENDPOINTincludes port:9000 - Check MinIO credentials are correct
CORS Errors:
- Verify backend URL is correct in frontend env vars
- Check both services have public networking enabled
File Upload Errors:
- Ensure MinIO bucket
filesexists - Verify MinIO is accessible from backend service
- Check bucket policy is applied:
mc anonymous set-json bucket-policy.json myminio/files
View service logs in Railway dashboard:
- Click on service → Deployments → View Logs
Monthly costs (approximate):
- Railway Hobby Plan: $5/month per service
- PostgreSQL: $5/month
- Total: ~$25/month for 4 services
- Never commit secrets - Use Railway environment variables
- Use strong passwords for MinIO and database
- Keep services private except frontend/backend public networking
- Rotate Clerk keys regularly for production
Need help? Check Railway documentation or create an issue in the repository.