---
title: "How to Use pnpm on Heroku"
description: "Heroku’s Node.js buildpack supports pnpm, a fast, disk-efficient alternative to npm, and early users reported 10–40% faster install times on Heroku deployments. pnpm uses a content-addressable store and symlinks to avoid duplicate packages, accelerates dependency installation by combining resolve, fetch, and linking, and enforces dependency boundaries. The tutorial uses Node.js v18 or higher and Corepack to initialize and pin pnpm 9, then creates an Express application whose pnpm-lock.yaml enables buildpack support and consistent package resolution. The demo server handles HTTP GET requests with “Hello pnpm!” and listens on process.env.PORT or defaults to 3000. It finishes by adding a Procfile, committing the project to Git, creating a Heroku app, and deploying with git push heroku main."
---

# How to Use pnpm on Heroku

[Heroku](https://yomu.fyi/company/heroku) · Colin Casey · Jul 19, 2024

**Type:** Tutorial

## Summary

Heroku’s Node.js buildpack supports pnpm, a fast, disk-efficient alternative to npm, and early users reported 10–40% faster install times on Heroku deployments. pnpm uses a content-addressable store and symlinks to avoid duplicate packages, accelerates dependency installation by combining resolve, fetch, and linking, and enforces dependency boundaries. The tutorial uses Node.js v18 or higher and Corepack to initialize and pin pnpm 9, then creates an Express application whose pnpm-lock.yaml enables buildpack support and consistent package resolution. The demo server handles HTTP GET requests with “Hello pnpm!” and listens on process.env.PORT or defaults to 3000. It finishes by adding a Procfile, committing the project to Git, creating a Heroku app, and deploying with git push heroku main.

## Context

The post explains how to use pnpm for Node.js projects deployed on Heroku. It presents pnpm as an alternative to npm that can reduce disk usage and improve installation speed, with early application owners reporting 10–40% faster install times on Heroku deployments.

## Approach / What changed

The tutorial enables Corepack, initializes and pins pnpm 9, adds Express, and creates a pnpm-lock.yaml file. It then builds a small Express server, adds a Procfile, initializes a Git repository, commits the project, creates a Heroku application, and deploys it with git push heroku main.

## Takeaways

- The Heroku Node.js buildpack requires pnpm-lock.yaml to enable pnpm support; the lockfile also keeps package resolution consistent and can allow resolution to be skipped for faster builds.
- Corepack can initialize pnpm and pin an exact version, including an integrity signature, in package.json’s packageManager field for deterministic builds.
- pnpm uses a content-addressable store and symlinks instead of duplicate package copies, while enforcing dependency boundaries against implicit transitive dependencies.

**Tags:** [Heroku](https://yomu.fyi/topic/heroku), [Node.js](https://yomu.fyi/topic/node-js), [pnpm](https://yomu.fyi/topic/pnpm)

- Source: [Heroku](https://www.heroku.com/blog/using-pnpm-on-heroku)
- Source URL: https://www.heroku.com/blog/using-pnpm-on-heroku
- Ingested by Yomu: 2026-09-10T00:02:37.255Z

[Read original post](https://www.heroku.com/blog/using-pnpm-on-heroku)
