Deploy on Coolify ​
This page covers deploying a Boring Stack app on Coolify.
GitHub Repo ​
Push your app to a repo on GitHub.
Create database ​
In your Coolify dashboard, create a PostgreSQL database as a one-click resource and take note of the connection url.
Create Redis instance ​
In your Coolify dashboard, create a Redis instance as a one-click resource and take note of the connection url.
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 ​
Set up the Redis adapter in config/environment/production.js
module.exports = {
session: {
secret: process.env.SESSION_SECRET,
adapter: '@sailshq/connect-redis',
url: process.env.REDIS_URL
}
}Create application ​
- In your Coolify dashboard, create a new Application from your Git repository
- Select the repository containing your app
- Choose Dockerfile as the build pack
Dockerfile included
The Boring Stack templates come with a production-ready Dockerfile, so you don't need to create one manually.
Set environment variables ​
In your Node application settings on Coolify, add the following environment variables:
DATABASE_URL: Use the connection string from the PostgreSQL database you createdREDIS_URL: Use the connection string from the Redis instance you createdSESSION_SECRET: A unique production session secret to override the one inconfig/session.js
Getting connection URLs
You can find the connection URLs for your PostgreSQL and Redis services in their respective settings pages on Coolify. Use the internal URLs for better performance and security.
Additional environment variables
Depending on the template you're using, you may need to set additional environment variables. For example, the Ascent template requires additional configuration for authentication, teams, and billing features.
Deploy ​
Click Deploy in Coolify. Your app will be built using the Dockerfile and deployed automatically.
After the build finishes, Coolify deploys the app to the configured domain.