Railway

Deploy Mix Space Core

A modern personal website backend server

Deploy Mix Space Core

Just deployed

MongoDB

mongo:8.0

Just deployed

/data/db

Just deployed

/data

Deploy and Host Mix Space Core on Railway

Mix Space Core is a modern backend server for personal websites built with Node.js. It provides RESTful APIs for personal websites, blogs, and content management workflows. The application includes MongoDB database support, Redis caching, JWT authentication, and content management capabilities for building and powering a personal website backend.

About Hosting Mix Space Core

Hosting Mix Space Core on Railway involves deploying the application together with MongoDB and Redis as three services within the same Railway project. The Mix Space Core service runs on port 2333 and communicates with MongoDB and Redis through Railway's private networking. MongoDB requires persistent storage mounted at /data/db, while Redis uses a volume mounted at /data. The application also uses /root/.mx-space for its own persistent data. Railway provides the public HTTP endpoint for the API while keeping the database and Redis services private. JWT authentication requires a secure secret, and CORS origins can be configured through the ALLOWED_ORIGINS variable.

Common Use Cases

  • Providing a REST API backend for a personal website or blog
  • Managing website and blog content through a centralized content management backend
  • Powering applications that require MongoDB storage, Redis caching, and JWT authentication

Dependencies for Mix Space Core Hosting

  • MongoDB
  • Redis
  • Persistent Railway Volumes
  • JWT secret
  • Allowed CORS origins

Deployment Dependencies

Implementation Details

Docker

Deploy the following Docker images as separate Railway services:

Mix Space Core

innei/mx-server:latest

MongoDB

mongo:latest

Redis

redis:alpine

Railway can deploy these prebuilt Docker images directly, so no custom Dockerfile or build command is required.

Public Networking

Only the Mix Space Core service needs public networking.

ServiceProtocolProxy TypeTarget PortPublic
mx-serverHTTPHTTP Proxy2333Yes
MongoDBTCPPrivate networking27017No
RedisTCPPrivate networking6379No

Generate a Railway domain for the mx-server service on port 2333. MongoDB and Redis should remain private and should be accessed through Railway private networking.

Environment Variables

Configure the following variables on the mx-server service:

VariableRequiredDescription
ALLOWED_ORIGINSYesComma-separated list of origins allowed to access the API through CORS
DB_HOSTYesPrivate hostname of the MongoDB service
JWT_SECRETYesSecure secret used for JWT token encryption
NODE_ENVYesApplication environment. Set to production
REDIS_HOSTYesPrivate hostname of the Redis service
TZYesApplication timezone

Raw Editor example:

ALLOWED_ORIGINS=https://your-domain.com
DB_HOST=${{MongoDB.RAILWAY_PRIVATE_DOMAIN}}
JWT_SECRET=YOUR_SECURE_JWT_SECRET
NODE_ENV=production
REDIS_HOST=${{Redis.RAILWAY_PRIVATE_DOMAIN}}
TZ=Asia/Shanghai

Use Railway reference variables for the database services rather than public hostnames. The service names used in the references must match the corresponding Railway service names.

Generate a strong, unique value for JWT_SECRET. Do not reuse publicly exposed secrets or commit the value to source control.

Persistent Storage

Persistent storage is required for all three services.

For MongoDB, add a Railway Volume with:

/data/db

For Redis, add a Railway Volume with:

/data

For Mix Space Core, add a Railway Volume with:

/root/.mx-space

These volumes preserve the database, Redis data, and Mix Space Core application data across service restarts and redeployments.

Database

Mix Space Core requires MongoDB.

Deploy:

mongo:latest

MongoDB listens on port 27017 and should remain private.

Configure the Mix Space Core service's DB_HOST to reference the MongoDB Railway private domain:

DB_HOST=${{MongoDB.RAILWAY_PRIVATE_DOMAIN}}

The supplied template does not document MongoDB authentication variables, so no additional database credentials should be invented.

Redis

Mix Space Core also requires Redis for caching.

Deploy:

redis:alpine

Redis listens on port 6379 and should remain private.

Configure the Mix Space Core service to reference Redis through Railway private networking:

REDIS_HOST=${{Redis.RAILWAY_PRIVATE_DOMAIN}}
Build & Start

No custom build or start commands are required.

Railway deploys the prebuilt innei/mx-server:latest image directly.

Accessing the Application
  1. Create a new Railway project.
  2. Create a MongoDB service using mongo:latest.
  3. Add a MongoDB Volume mounted at /data/db.
  4. Create a Redis service using redis:alpine.
  5. Add a Redis Volume mounted at /data.
  6. Create the Mix Space Core service using innei/mx-server:latest.
  7. Add a Volume to Mix Space Core mounted at /root/.mx-space.
  8. Configure the required environment variables.
  9. Set DB_HOST to the MongoDB Railway private domain.
  10. Set REDIS_HOST to the Redis Railway private domain.
  11. Generate a Railway domain for Mix Space Core on port 2333.
  12. Access the API using the generated HTTPS URL.

The supplied template does not document default credentials or a default administrative login.

The Mix Space Core API is available through the generated Railway domain, for example:

https://

Only the Mix Space Core service should be publicly accessible. Keep MongoDB and Redis on Railway's private network.

Why Deploy Mix Space Core 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 Mix Space Core 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

More templates in this category

View Template
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