Subcommands67 subcommands
pm2 start
Starts and daemonizes an app
pm2 trigger
Deploy your json
pm2 deploy
Deploy your json
pm2 startOrRestart
Start or restart JSON file
pm2 startOrReload
Start or gracefully reload JSON file
pm2 pid
Return pid of the specified app or all
pm2 startOrGracefulReload
Start or gracefully reolad JSON file
pm2 restart
Restart a process
pm2 scale
Scale up/down a process in cluster mode depending on the `number` param
pm2 snapshot
Snapshot PM2 memory
pm2 reload
Reload processes (for apps using HTTP/HTTPS)
pm2 gracefulReload
Gracefully reload a process. Send a “shutdown” message to close all connections
pm2 id
Get process id by name
pm2 delete
Stops and deletes a process from pm2 process list
pm2 sendSignal
Send a system signal to the target process
pm2 ping
Ping pm2 daemon - if not it will launch up
pm2 updatePM2
Update in-memory PM2 with local PM2
pm2 update
(alias) update in-memory PM2 with local PM2
pm2 install
Install or update a module and run it forever
pm2 module:generate
Generate a sample module in current folder
pm2 uninstall
Stop and uninstall a module
pm2 publish
Publish the module you are currently on
pm2 set
Sets the specified config
pm2 multiset
Multiset eg `key1 val1 key2 val2`
pm2 get
Get value for the specified key
pm2 conf
Get / set module config values
pm2 config
Get / set module config values
pm2 unset
Clears the specified config key
pm2 report
Give a full pm2 report for https://github.com/Unitech/pm2/issues
pm2 link
Linking action to keymetrics.io
pm2 unlink
Linking action to keymetrics.io
pm2 unmonitor
Unmonitor target process
pm2 monitor
<Unm>onitor target process
pm2 open
Open dashboard in browser
pm2 register
Create an account on keymetrics
pm2 login
Login to keymetrics and link current PM2
pm2 web
Launch a health API on 0.0.0.0:9615
pm2 dump
Dump all processes for resurrecting them later
pm2 send
Send stdin to pm id
pm2 attach
Attach stdin/stdout to application identified by pm id
pm2 resurrect
Resurrect previously dumped processes
pm2 unstartup
Disable and clear auto startup
pm2 startup
Setup script for pm2 at boot
pm2 logrotate
Copy default logrotate configuration
pm2 ecosystem
Generate a process conf file
pm2 reset
Reset counters for process
pm2 describe
Describe all parameters of a process id
pm2 desc
(alias) Describe all parameters of a process id
pm2 list
List all processes
pm2 l
(alias) list all processes
pm2 jlist
List all processes in JSON format
pm2 prettylist
Print json in a prettified JSON
pm2 monit
Launch termcaps monitoring
pm2 imonit
Launch legacy termcaps monitoring
pm2 dashboard
Launch dashboard with monitoring and logs
pm2 reloadLogs
Reload all logs
pm2 logs
Stream logs logs file
pm2 pull
Updates repository for a given app
pm2 forward
Updates repository to the next commit for a given app
pm2 backward
Downgrades repository to the previous commit for a given app
pm2 gc
Force PM2 to trigger garbage collection
pm2 deepUpdate
Performs a deep update of PM2
pm2 serve
Serves a directory over http via port
OptionsOn pm2 itself
-V--version
Outputs the version number
-s--silent
Hides all messages
-m--mini-list
Displays a compacted list without formatting
--disable-logs
Do not write logs
-n--name
Sets a name for script <name>
-i--instances
Launches [number] instances (for networked app)(load balanced) <number>
--parallel
Number of parallel actions (for restart/reload) <number>
-l--log
Specifies entire log file (error and out are both included) <path>
-o--output
Specifies out log file <path>
-e--error
Specifies error log file <path>
-p--pid
Specify pid file <pid>
-k--kill-timeout
Delays before sending final SIGKILL signal to process <delay>
--listen-timeout
Listen timeout on application reload <delay>
--max-memory-restart
Specify max memory amount used to autorestart (in octet or use syntax like 100M) <memory>
--restart-delay
Specify a delay between restarts (in milliseconds) <delay>
--env
Specify environment to get specific env variables <Environment Name>
--log-type
Specify log output style (raw by default, json optional) <type>
-x--execute-command
Execute a program using fork system
--max-restarts
Only Restart the script COUNT times <Count>
-u--user
Defines user when generating startup script <username>
--uid
Runs target script with <uid> rights <uid>
--gid
Runs target script with <gid> rights <gid>
--cwd
Runs target script as <username> <path>
--hp
Defines home path when generating startup script <home path>
--wait-ip
Overrides systemd script to wait for full internet connectivity to launch pm2
--service-name
Defines service name when generating startup script <name>
-c--cron
Restarts a running process based on a cron pattern <Cron Pattern>
-w--write
Writes configuration in local folder
--interpreter
The interpreter pm2 should use for executing app (bash, python…) <interpreter>
--interpreter-args
Interprets options (alias of –node-args) <Arguments>
--log-date-format
Adds custom prefix timestamp to logs <Date Format>
--no-daemon
Runs pm2 daemon in the foreground if it doesn’t exist already
-a--update-env
Updates environment on restart/reload (-a <=> apply)
–-source-map-support
Force source map support
–-only
With json declaration, allow to only act on one application <app name>
–-disable-source-map-support
Force source map support
–-wait-ready
Asks pm2 to wait for ready event from your app
–-merge-logs
Merges logs from different instances but keep error and out separated
–-watch
Watches application folder for changes (default: ) <paths>
–-ignore-watch
Folder/files to be ignored watching <Folder or Files>
–-node-args
Space delimited arguments to pass to node in cluster mode <Node Args>
–-no-vizion
Starts an app without vizion feature (versioning control)
–-no-autorestart
Starts an app without automatic restart
–-no-treekill
Only kills the main process, not detached children
–-no-pmx
Starts an app without apm
–-no-automation
Starts an app without apm
–-trace
Enables transaction tracing with km
–-disable-trace
Disables transaction tracing with km
–-attach
Attaches logging after your start/restart/stop/reload
–-sort
Sort process according to field’s name <field name>
–-v8
Enables v8 data collecting
–-event-loop-inspector
Enables event-loop-inspector dump in apm
–-deep-monitoring
Enables all monitoring tools (equivalent to –v8 –event-loop-inspector –trace)
-h–-help
Outputs usage information