How to deploy monorepos with npm, yarn or pnpm on Hostinger

Deploy one app from a monorepo and choose npm, yarn or pnpm on Hostinger.

Updated 14 hours ago

Hostinger Node.js monorepo hosting supports npm, yarn and pnpm, and lets you deploy any app from a repository that holds several apps. Hostinger detects the package manager from your lock file, and you choose which app to deploy with the Root directory setting. Each app from a monorepo is deployed as a separate Node.js website.

Package managers supported

Hostinger supports three package managers and picks one automatically based on the lock file in your project:

Lock file

Package manager used

package-lock.json

npm

yarn.lock

yarn

pnpm-lock.yaml

pnpm

Hostinger also follows the packageManager field in package.json, for example "packageManager": "pnpm@9.0.0", to use a specific version. Bun isn’t supported.

Deploy one app from a monorepo

Step 1 – Start a GitHub deployment

Start a new Node.js deployment from your GitHub repository, as described in how to add a Node.js web app in Hostinger.

Step 2 – Set the root directory

In the build settings, set Root directory to the folder of the app you want to deploy, for example apps/web.

Step 3 – Set the build command, output directory and entry file

Enter the build command, output directory and entry file for that specific app, then click Deploy. To change these settings later, redeploy the Node.js application with the updated values.

NOTE

Deploy Turborepo or Nx workspaces

Keep Root directory set to the repository root (./) for Turborepo or Nx workspaces that need the whole repository installed. Then use a build command that builds only one app, and point the output directory to that app:

  • Build command: pnpm --filter web build
  • Output directory: apps/web/.next

Replace web with the name of your app’s package. If an app doesn’t show your latest changes after deployment, see how to fix changes not showing after a Node.js deployment at Hostinger.

With the root directory and build settings set for each app, every app in your monorepo deploys and updates as its own Node.js website.