A production-ready, one-click deployment template for Directus on Railway. Deploy a fully configured headless CMS with PostgreSQL database, Redis cache, and S3 storage in minutes—no configuration required.
Directus is an open-source headless CMS that lets you create, manage, and scale content. Design your data model, build powerful REST and GraphQL APIs, and manage content for anything from simple websites to complex applications.
- Directus CMS - Headless CMS with REST + GraphQL API
- PostgreSQL Database - Automatically provisioned and linked via Railway's private network
- Redis Cache - Enabled for caching and WebSocket support
- Railway S3 Storage - Persistent file storage for multi-replica deployments
- CMS Template - Pre-configured content collections (pages, posts, forms, navigation) applied on first deploy
- Auto-setup Scripts - Admin user and CMS template automatically configured
- Health Checks - Built-in monitoring for Railway
- Frontend Starters - Ready to connect to Next.js, Nuxt, Astro, and SvelteKit
-
- Production Ready - Configured with best practices, security, and scalability in mind
- Click the Deploy on Railway button above
- Railway will automatically:
- Generate a secure
SECRET(encryption key) - Set your
PUBLIC_URL(from your Railway domain) - Provision a PostgreSQL database
- Provision a Redis cache
- Provision a Railway S3 storage bucket
- Link all services to Directus via private network (zero egress fees)
- Deploy your Directus instance
- Create your admin user with secure credentials
- Apply CMS template with pre-configured collections, flows, and dashboards
- Generate a secure
- Access your Directus admin panel at your Railway URL
Connect your Directus backend to Next.js, Nuxt, Astro, or SvelteKit starters from directus-labs/starters.
See FRONTEND_ADDONS.md for complete setup instructions.
All communication between services (Directus, PostgreSQL, Redis, Storage) happens over Railway's private network. This means:
- Zero egress fees for database and cache operations
- Secure - services are not exposed externally by default
- Fast - private network communication is optimized
Uses Railway's S3-compatible storage buckets for file storage:
- Multi-replica support - Share storage across multiple Directus instances
- Persistent - Files survive container restarts and deployments
- Scalable - No storage limits tied to container size
- Automatic configuration - S3 bucket is automatically provisioned and configured
The CMS template includes automatic setup scripts that:
- Create admin user on first deployment with secure credentials
- Apply CMS template with pre-configured collections (pages, posts, forms, navigation, etc.)
- Install and configure popular extensions from the marketplace
- Configure S3 storage bucket automatically
- Set up health checks and monitoring
- Create sample flows and dashboards
Run Directus locally using Docker Compose with the same configuration as Railway:
-
Navigate to directus directory:
cd directus -
Set up environment variables:
cp .env.example .env # Edit .env with your values -
Start services:
docker-compose up -d
-
Access Directus:
- Admin Panel: http://localhost:8055
- Admin credentials are created automatically if
ADMIN_EMAILandADMIN_PASSWORDare set in your.envfile
Note: Local development uses local file storage by default. For S3 storage locally, configure the S3 environment
variables in your .env file (see docker-compose.yml for available options).
scripts/start-directus.sh- Startup script that runs Directus bootstrap and optionally applies CMS templatescripts/bootstrap-admin.sh- Admin user creation and template loading (CMS template only)
- Directus Documentation: https://docs.directus.io
- Railway Documentation: https://docs.railway.app
- Frontend Integration Guide: FRONTEND_ADDONS.md
- Directus Community Discord: https://directus.chat
- Directus GitHub: https://github.com/directus/directus
- Report Issues: https://github.com/directus-labs/directus-railway-cms-template/issues
MIT License - see LICENSE file for details.
