Deploy on Railway β
Let's deploy your app on Railway π
You have two options to deploy your app on Railway...
- Use the One-click deploy if you're just starting out.
- Or follow the GitHub Repo steps if youβve already started building your app.
One-click deploy mellow-vue β
Simply click the button, and Railway will set up everything you need to get your new app live using the mellow-vue
Railway template.
This template includes:
- Mellow Vue: The Boring Stack Mellow template with Vue.js.
- PostgreSQL: A pre-configured PostgreSQL database.
- Redis: A pre-configured Redis instance.
One-click deploy mellow-react β
Simply click the button, and Railway will set up everything you need to get your new app live using the mellow-react
Railway template.
This template includes:
- Mellow React: The Boring Stack Mellow template with React.js.
- PostgreSQL: A pre-configured PostgreSQL database.
- Redis: A pre-configured Redis instance.
One-click deploy mellow-svelte β
Simply click the button, and Railway will set up everything you need to get your new app live using the mellow-svelte
Railway template.
This template includes:
- Mellow Svelte: The Boring Stack Mellow template with Svelte.js.
- PostgreSQL: A pre-configured PostgreSQL database.
- Redis: A pre-configured Redis instance.
GitHub Repo β
Push your app to a repo on GitHub.
Create database β
Create the database you want to use for production on Railway and take note of the connection url.
Database creation guides
See guides for MySQL, PostgreSQL, and, MongoDB on the Railway docs.
Create Redis instance β
Create the production Redis instance and take note of the connection url.
Redis instance guide
See the guide to create a Redis instance on the Railway docs.
Set up database β
Depending on the database you want to use for production, set up that adapter in config/environment/production.js
module.exports = {
datastores: {
default: {
adapter: 'sails-postgresql',
url: process.env.DATABASE_URL
}
}
}
module.exports = {
datastores: {
default: {
adapter: 'sails-mysql',
url: process.env.DATABASE_URL
}
}
}
module.exports = {
datastores: {
default: {
adapter: 'sails-mongo',
url: process.env.DATABASE_URL
}
}
}
WARNING
Don't forget to install the adapter if you haven't already. See the database docs for more info.
Set up Redis β
INFO
Create a new Redis instance on Railway by following the Railway docs.
Set up the Redis adapter in config/environment/production.js
module.exports = {
session: {
secret: process.env.REDIS_SECRET
adapter: '@sailshq/connect-redis',
url: process.env.REDIS_URL
}
}
Create a web service β
Create a new Web Service on Railway, and give Railway permission to access the repo of your app.
If necessary, use the following values during creation:
- Runtime:
Node
- Build command:
npm i
- Start command:
npm start
However, Railway is capable of configuring things automatically for you.
Set environment variables β
Add the following evironment variables to your web service:
DATABASE_URL
: This should point to the connection string of the database you created.REDIS_URL
: This should point to the connection string to the Redis instance you created.SESSION_SECRET
: A unique production session secret to override the one inconfig/session.js
.
Thatβs it! Your app will be live on your Railway URL as soon as the build finishes π
Celebrate with a β β
Star The Boring JavaScript Stack repo on GitHub β
Let's celebrate deploying your app on Railway by giving The Boring JavaScript Stack a star on GitHub.