@greda, I was able to figure a solution I’d sort of seen elsewhere to this exact issue, as I was having the same problem. Created an account to document the solution as this is the first thread that comes up when searching for a solution.
On a completely clean installation, and copy/pasting the terminal commands to install, I could get MM running just fine using pm2, but it would not auto-start. As it turns out, I missed a part of the auto-start instructions, and this caused the problem. Here’s my solution:
- Look for the step “Starting PM2 on Boot”
- Command is “pm2 startup”
- There’s an instruction line there that’s easy to miss, which is this: "PM2 will now show you a command you need to execute."
- IN THE TERMINAL, there is an output to the “pm2 startup” command when it’s done running saying that you need to copy and then re-paste to sent environmental variables
- Copy/paste the output text from “pm2 startup” out of, then back into, Terminal
- Proceed with the rest of the auto-start instructions as documented
This cleanly and easily solved the issue for me - it’s an easy step in the instructions to miss as it’s the only one where you need to do something with the output of the setup commands.