Files
nexus/wiki/concepts/pm2.md

25 lines
766 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "pm2"
type: concept
tags: [process-manager, node, ubuntu, vibe-coding]
last_updated: 2026-04-15
---
## Definition
Node.js 进程管理器,提供进程守护、日志管理、开机自启功能,适合生产环境长期运行 Node 服务。
## Core Mechanism
- 安装npm install -g pm2
- 启动pm2 start "command" --name <app-name>
- 日志pm2 logs <app-name>
- 保存pm2 save保存当前进程列表
- 开机自启pm2 startup systemd -u <user> --hp <home-dir>
- 进程列表pm2 status
## Use Case
管理 Ubuntu Server 上的 Vibe-Kanban Web UI 进程PORT 9999确保服务持续运行并开机自启。
## Connections
- [[pm2]] ← 管理 ← [[Vibe-Kanban]]
- [[OpenCode Executor]] ← spawn by ← [[Vibe-Kanban]]