">
 

Install PM2

Iniciado por joomlamz, 29 de Maio de 2026, 16:35

Respostas: 0   |   Visualizações: 8

Tópico anterior - Tópico seguinte

0 Membros e 1 Visitante estão a ver este tópico.

Install PM2



Tópico: Install PM2
Categoria: Tutoriais | Programação & Tecnologia
Idioma Principal: Português (Conteúdo de Tecnologia)

Descrição do Conteúdo / Informações:
-------------------------------------------------------------------------
Originally posted on Web Warrior Toolbox

On a server where you've already installed npm or pnpm, you can add PM2 to manage your backend application.

If you're not sure about your fnm/pnpm setup, check this tutorial.



Why PM2?


PM2 provides features you don't get by simply running npm run start or pnpm run dev:


Simple start → pm2 start dist/main.js


Health check → pm2 ls shows running apps


Auto‑restart on reboot → configure with pm2 startup


Consistency → same commands everywhere, instead of arbitrary start/dev/prod scripts chosen by different developers

In short: PM2 gives you peace of mind and a unified workflow.

To install pm2 you have 2 paths:

Method

Command

Pros

Cons

npm global

`npm install -g pm2`

Works out of the box, PATH already set
Slightly heavier installs

pnpm global

`pnpm add -g pm2`

Disk space efficient

Needs PATH fix (`~/.local/share/pnpm`)

In this case I recommend using npm so you won't need to fix the path.



Install with npm


npm install -g pm2
pm2 --version

Use this for your projects and keep updating your knowledge 🙌, Dev-san.


Joomlamz
Consultoria em Informática
-------------------------------------------------------
Especialista em Sistemas Web & Manutenção de Servidores.
A desenvolver o novo AplPortal com suporte a PHP 8.
Precisa de ajuda profissional? Contacte-me.

Tags: