pm2 start <file, json, stdin, app name, pm id, etc>

Starts and daemonizes an app

Arguments

NameDescription
file, json, stdin, app name, pm id, etc

Options

NameDescription
-V, --versionOutputs the version number
-vGets version
-s, --silentHides all messages
-m, --mini-listDisplays a compacted list without formatting
-f, --forceForces actions
--disable-logsDo not write logs
-n, --name <name>Sets a name for script
-i, --instances <number>Launches [number] instances (for networked app)(load balanced)
--parallel <number>Number of parallel actions (for restart/reload)
-l, --log [path]Specifies entire log file (error and out are both included)
-o, --output <path>Specifies out log file
-e, --error <path>Specifies error log file
-p, --pid <pid>Specify pid file
-k, --kill-timeout <delay>Delays before sending final SIGKILL signal to process
--listen-timeout <delay>Listen timeout on application reload
--max-memory-restart <memory>Specify max memory amount used to autorestart (in octet or use syntax like 100M)
--restart-delay <delay>Specify a delay between restarts (in milliseconds)
--env <Environment Name>Specify environment to get specific env variables
--log-type <type>Specify log output style (raw by default, json optional)
-x, --execute-commandExecute a program using fork system
--max-restarts [Count]Only Restart the script COUNT times
-u, --user <username>Defines user when generating startup script
--uid <uid>Runs target script with <uid> rights
--gid <gid>Runs target script with <gid> rights
--cwd <path>Runs target script as <username>
--hp <home path>Defines home path when generating startup script
--wait-ipOverrides systemd script to wait for full internet connectivity to launch pm2
--service-name <name>Defines service name when generating startup script
-c, --cron <Cron Pattern>Restarts a running process based on a cron pattern
-w, --writeWrites configuration in local folder
--interpreter <interpreter>The interpreter pm2 should use for executing app (bash, python…)
--interpreter-args <Arguments>Interprets options (alias of –node-args)
--log-date-format <Date Format>Adds custom prefix timestamp to logs
--no-daemonRuns pm2 daemon in the foreground if it doesn’t exist already
-a, --update-envUpdates environment on restart/reload (-a <=> apply)
–-source-map-supportForce source map support
–-only <app name>With json declaration, allow to only act on one application
–-disable-source-map-supportForce source map support
–-wait-readyAsks pm2 to wait for ready event from your app
–-merge-logsMerges logs from different instances but keep error and out separated
–-watch <paths...>Watches application folder for changes (default: )
–-ignore-watch <Folder or Files...>Folder/files to be ignored watching
–-node-args <Node Args>Space delimited arguments to pass to node in cluster mode
–-no-colorSkip colors
–-no-vizionStarts an app without vizion feature (versioning control)
–-no-autorestartStarts an app without automatic restart
–-no-treekillOnly kills the main process, not detached children
–-no-pmxStarts an app without apm
–-no-automationStarts an app without apm
–-traceEnables transaction tracing with km
–-disable-traceDisables transaction tracing with km
–-attachAttaches logging after your start/restart/stop/reload
–-sort <field name>Sort process according to field’s name
–-v8Enables v8 data collecting
–-event-loop-inspectorEnables event-loop-inspector dump in apm
–-deep-monitoringEnables all monitoring tools (equivalent to –v8 –event-loop-inspector –trace)
-h, –-helpOutputs usage information