Railway

Deploy Saas Start Kit

SaaS application using Next.js ,authentication, Stripe ,dashboard

Deploy Saas Start Kit

/var/lib/postgresql/data

Just deployed

Deploy and Host SaaS Starter Kit on Railway

SaaS Starter Kit is a production-ready Next.js 15 SaaS boilerplate designed for high-performance applications. It features multi-tenant workspaces, role-based access control (RBAC), Stripe subscription billing, developer API key management, security audit logging, and a command palette interface. It is built for developers and teams looking to launch scalable SaaS products quickly.

About Hosting SaaS Starter Kit

Deploying SaaS Starter Kit on Railway provides a fully managed, containerized environment using standard Docker infrastructure. Railway automatically builds the application directly from the repository's multi-stage Dockerfile and deploys it with automated HTTPS termination, edge routing, and built-in health checking via the /api/health endpoint.

Database capabilities are powered by a managed Railway PostgreSQL service, which connects seamlessly to the application using Drizzle ORM. Railway simplifies operational complexity by managing environment variables, reference cross-service URLs, automatic builds, and scale-on-demand resource management without requiring manual server configuration.

Common Use Cases

  • Subscription-based Software as a Service (SaaS) platforms
  • Multi-tenant team workspace applications and client portals
  • API management dashboards with user developer keys and audit logs

Dependencies for SaaS Starter Kit Hosting

DependencyTypePurpose
PostgreSQLDatabasePrimary relational database for users, teams, subscriptions, and logs
Stripe APIExternal APIPayment gateway, checkout sessions, and webhook handling

Deployment Dependencies

Implementation Details

Docker

The application includes a production-ready Dockerfile in the root directory. Railway automatically detects and builds this image without requiring custom build parameters.

Public Networking
Networking OptionValue
Proxy TypeHTTP Proxy
Target Port8080
Environment Variables
VariableRequiredDescription
POSTGRES_URLYesRailway PostgreSQL connection string (${{Postgres.DATABASE_URL}})
AUTH_SECRETYesEdge-compatible session JWT secret key (random 32-character string)
BASE_URLYesBase public domain URL (https://${{RAILWAY_PUBLIC_DOMAIN}})
STRIPE_SECRET_KEYYesStripe API secret key obtained from the Stripe Dashboard
STRIPE_WEBHOOK_SECRETYesStripe webhook signing secret obtained from Stripe Webhooks settings
PORTNoApplication listening port (defaults to 3000)

Example configuration for the Railway Variables Raw Editor:

POSTGRES_URL=${{Postgres.DATABASE_URL}}
AUTH_SECRET=your-random-32-character-secret-key
BASE_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
PORT=8080

Persistent Storage

Persistent volumes are not required. All user data, workspace details, and session data are stored directly in the PostgreSQL database.

Database

A PostgreSQL database service is required.

  1. Add a PostgreSQL database service to your Railway project.
  2. Link the database to your application service using the Railway reference variable ${{Postgres.DATABASE_URL}} assigned to POSTGRES_URL.
  3. Run database migrations during initial deployment using pnpm db:migrate or seed initial data via pnpm db:seed.
Build & Start

Railway automatically builds the project using the multi-stage Dockerfile.

  • Build Command: pnpm db:migrate (Optional post-build step for database schema application)
  • Start Command: Managed automatically by the Dockerfile container entrypoint.
Accessing the Application
  1. Open the application service in Railway.
  2. Navigate to SettingsNetworkingPublic Networking.
  3. Click Generate Domain to assign a public Railway URL.
  4. Open the generated domain in your browser.
  5. If seeded using pnpm db:seed, log in with default credentials:
  • Email: test@test.com
  • Password: admin123

Why Deploy SaaS Starter Kit on Railway?

Railway is the best place to deploy SaaS Starter Kit. With instant deployments, infrastructure as code, continuous delivery, and automatic HTTPS, Railway makes it simple to run applications in production without managing servers or cluster configuration.


Template Content

More templates in this category

View Template
NEW
Paperless-ngx
Document management with OCR on Railway with PostgreSQL and Redis

INAPP
1
View Template
open-excalidraw
Self-hostable collaborative drawing built on Excalidraw

Prateek Mohanty
1
View Template
caring-vibrancy
Deploy and Host caring-vibrancy with Railway

5