
Deploy GritCMS
GritCMS — The Open-Source Creator Operating System
GritCMS Web
Just deployed
GritCMS Admin
Just deployed
Redis
Just deployed
/data
GritCMS Files
Just deployed
GritCMS API
Just deployed
Just deployed
/var/lib/postgresql/data
Bucket
Bucket
Just deployed
Deploy and Host GritCMS on Railway
GritCMS is a free, open-source Creator Operating System built for course creators, coaches, and digital product sellers. It combines the tools you'd normally pay $700–1,500/month for courses, email, pages, funnels, and digital products into a single self-hosted platform.
About Hosting GritCMS
GritCMS is a monorepo consisting of three services: a high-performance Go API backend, a Next.js admin dashboard, and a Next.js public-facing website. It requires PostgreSQL for data storage and Redis for caching. Media uploads are handled via Railway's built-in S3-compatible Storage Buckets, with public file serving provided by the S3 Public Presigner service. Outbound email is handled via Resend. All five services run together in a single Railway project with automatic private networking between them.
Common Use Cases
- [Sell and deliver online courses with a built-in course platform]
- [Send transactional and marketing emails without a third-party ESP]
- [Build and publish landing pages, blog posts, and sales funnels]
- [Sell digital products and manage orders with Stripe payments]
- [Replace expensive SaaS tools like Kajabi with a self-hosted alternative]
Dependencies for GritCMS Hosting
- [PostgreSQL — primary database, provisioned automatically via Railway]
- [Redis — cache and background job queue, provisioned automatically via Railway]
- [Railway Storage Bucket — S3-compatible object storage for media uploads]
- [S3 Public Presigner — serves private bucket files via public URLs]
- [Resend — transactional email provider (free tier: 3,000 emails/month)]
- [Stripe — payment processing for products and subscriptions (optional)]
Deployment Dependencies
- [GritCMS GitHub Repository]
- [GritCMS Documentation]
- [Resend]
- [Stripe]
- [S3 Public Presigner]
Implementation Details
Monorepo Build Configuration
GritCMS is a shared pnpm monorepo. All three services (API, Admin, Web) must build from the repo root — not a subdirectory — so Docker can access packages/shared and pnpm-workspace.yaml. Set the Root Directory to blank for all services and use RAILWAY_DOCKERFILE_PATH to point each service to its correct Dockerfile:
- API:
RAILWAY_DOCKERFILE_PATH=apps/api/Dockerfile - Admin:
RAILWAY_DOCKERFILE_PATH=apps/admin/Dockerfile - Web:
RAILWAY_DOCKERFILE_PATH=apps/web/DockerfileNEXT_PUBLIC_API_URL
This variable must include the https:// protocol prefix and be set before the Next.js build runs — it is baked in at build time, not runtime. A redeploy (not just a restart) is required after changing it:
NEXT_PUBLIC_API_URL=https://your-api-domain.up.railway.app
CORS Configuration
CORS_ORIGINS cannot be pre-populated in the template as the Web and Admin domains are not known until after first deploy. After deploying, set it in the API service with no trailing slashes and no spaces:
CORS_ORIGINS=https://your-admin-domain.up.railway.app,https://your-web-domain.up.railway.app
Storage
Railway Storage Buckets are used in place of Cloudflare R2. The S3 Public Presigner service makes private bucket files publicly accessible. The API uploads directly to the bucket using Bucket.* credentials, but R2_ENDPOINT points to the presigner service public domain so all media URLs are served publicly through it.
Homepage
Set a page's slug to home in the admin panel to make it the site homepage.
First User
The first user to register automatically becomes the platform owner. There is no default login or setup wizard — navigate directly to /sign-up on the admin domain to create the initial account.
Password Reset
Password reset email sending is not yet implemented in the current version of GritCMS (marked as Phase 4 in the codebase). The API accepts the request and returns a 200 response but no email is sent. Passwords can be reset directly via the Railway PostgreSQL database viewer as a workaround.
Why Deploy GritCMS 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 GritCMS 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
GritCMS Web
MUKE-coder/gritcmsGritCMS Admin
MUKE-coder/gritcmsRedis
redis:8.2.1GritCMS Files
timomeh/s3-public-presignerGritCMS API
MUKE-coder/gritcmsMAIL_FROM
The sender email address for all outgoing emails. Must be a domain verified in your Resend account.
CORS_ORIGINS
Required. Comma-separated list of your Web and Admin service public URLs. Set with a generic URL for inital deployment, then change after. Example: https://web.up.railway.app,https://admin.up.railway.app. Without setting this and redpolying the API service logins will fail. Note: No trailing slashes in the URLs.
RESEND_API_KEY
API key for sending emails via Resend. Get yours at resend.com — free tier supports 3,000 emails/month.
Bucket
Bucket
