Skip to content

Deploy on Render ​

Let's deploy your app on Render πŸš€

GitHub Repo ​

Push your app to a repo on GitHub.

Create database ​

Create the database you want to use for production on Render and take note of the connection url.

Database creation guides

See guides for MySQL, PostgreSQL, and, MongoDB on the Render 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 Render docs.

Set up database ​

Depending on the database you want to use for production, set up that adapter in config/environment/production.js

js
module.exports = {
  datastores: {
    default: {
      adapter: 'sails-postgresql',
      url: process.env.DATABASE_URL
    }
  }
}
js
module.exports = {
  datastores: {
    default: {
      adapter: 'sails-mysql',
      url: process.env.DATABASE_URL
    }
  }
}
js
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 Render by following the Render docs.

Set up the Redis adapter in config/environment/production.js

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 Node.js Web Service on Render, and give Render permission to access the repo of your app.

Use the following values during creation:

  • Runtime: Node
  • Build command: npm i
  • Start command: npm start

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 in config/session.js.

That’s it! Your app will be live on your Render 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 Render by giving The Boring JavaScript Stack a star on GitHub.

All open source projects are released under the MIT License.