Prerequisites
Before setting up pm2, make sure you have:- Node.js 22 or newer installed
- Comis built — run
pnpm buildin the Comis directory - pm2 installed globally:
Setup
1
Generate the config file
Run the setup command to generate the pm2 ecosystem config:Expected output:This creates
~/.comis/ecosystem.config.js with the correct paths to your
daemon binary and configuration file. You do not need to edit this file.2
Start Comis
Start the daemon through pm2:Expected output:
3
Verify it is running
Check the process status:You should see a table with Then check the logs to confirm the daemon started successfully:Look for
status: online:"Comis daemon started" in the output.Common commands
After rebuilding Comis (
pnpm build), always restart the daemon to pick up the
new code:Auto-start on boot
By default, pm2 processes stop when the server reboots. To make Comis start automatically on boot: 1. Generate the startup script:sudo. Copy and run the
exact command it shows you. For example:
Ecosystem config
Thepm2 setup command generates a config file at ~/.comis/ecosystem.config.js.
Here is what it contains:
Log management
pm2 stores its logs in~/.pm2/logs/, not in ~/.comis/. You will find two files:
comis-out.log— standard output (normal log messages)comis-error.log— standard error (error messages)
The daemon also supports its own file logging with rotation. See
Logging for details on configuring the daemon’s built-in
log rotation.
Related pages
Daemon
How the daemon starts, runs, and shuts down.
systemd
Run Comis as a systemd service on Linux.
Docker
Run Comis in a Docker container.
Logging
Configure log levels, rotation, and structured output.
Troubleshooting
Solutions to common issues.
