Deploy Mix Space Core
A modern personal website backend server
mx-server
Just deployed
MongoDB
Just deployed
/data/db
Redis
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.
| Service | Protocol | Proxy Type | Target Port | Public |
|---|---|---|---|---|
mx-server | HTTP | HTTP Proxy | 2333 | Yes |
MongoDB | TCP | Private networking | 27017 | No |
Redis | TCP | Private networking | 6379 | No |
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:
| Variable | Required | Description |
|---|---|---|
ALLOWED_ORIGINS | Yes | Comma-separated list of origins allowed to access the API through CORS |
DB_HOST | Yes | Private hostname of the MongoDB service |
JWT_SECRET | Yes | Secure secret used for JWT token encryption |
NODE_ENV | Yes | Application environment. Set to production |
REDIS_HOST | Yes | Private hostname of the Redis service |
TZ | Yes | Application 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
- Create a new Railway project.
- Create a MongoDB service using
mongo:latest. - Add a MongoDB Volume mounted at
/data/db. - Create a Redis service using
redis:alpine. - Add a Redis Volume mounted at
/data. - Create the Mix Space Core service using
innei/mx-server:latest. - Add a Volume to Mix Space Core mounted at
/root/.mx-space. - Configure the required environment variables.
- Set
DB_HOSTto the MongoDB Railway private domain. - Set
REDIS_HOSTto the Redis Railway private domain. - Generate a Railway domain for Mix Space Core on port
2333. - 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