Skip to content


Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Discord Backers on Open Collective Sponsors on Open Collective


This module contains integrated healthchecks for Nest.


@nestjs/terminus integrates with a lot of cool technologies, such as typeorm, grpc, mongodb, and many more! In case you have missed a dependency, @nestjs/terminus will throw an error and prompt you to install the required dependency. So you will only install what is actually required!

npm install --save @nestjs/terminus


  1. Import the Terminus module
  2. Make sure the additionally needed modules are available to (e.g. TypeOrmModule), in case you want to do Database Health Checks.
// app.module.ts

  controllers: [HealthController],
    // Make sure TypeOrmModule is available in the module context
    TypeOrmModule.forRoot({ ... }),
export class HealthModule { }
  1. Setup your HealthController which executes your Health Check.
// health.controller.ts

export class HealthController {
    private health: HealthCheckService,
    private db: TypeOrmHealthIndicator,
  ) {}

  readiness() {
      async () => this.db.pingCheck('database', { timeout: 300 }),

If everything is set up correctly, you can access the healthcheck on http://localhost:3000/health.

  "status": "ok",
  "info": {
    "database": {
      "status": "up"
  "details": {
    "database": {
      "status": "up"

For more information, see docs. You can find more samples in the samples/ folder of this repository.


In order to get started, first read through our Contributing guidelines.


Setup the development environment by following these instructions:

  1. Fork & Clone the repository
  2. Install the dependencies
npm install

# To rebuild the project, run
npm run build


For unit testing run the following command:

npm run test

For e2e testing, make sure you have docker installed

docker-compose up -d
npm run test:e2e


Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch


Nest is MIT licensed.