Answer the question
In order to leave comments, you need to log in
How to start pm2 on computer startup?
Colleagues, good day,
Tell me who was puzzled by this topic. When you start the computer, you need to run pm2 and pm2-web automatically. How to implement it???? Whatever the handles (
Thanks in advance
Answer the question
In order to leave comments, you need to log in
PM2 - Restart Processes After System Reboot
and execute as root, what will display, example:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup upstart -u vagrant --hp /home/vagrant
You can use systemd
to create a file /etc/systemd/system/node_api
containing approximately
[Unit]
Description=API
After=network.target
[Service]
User=username
Environment=HOST=localhost
WorkingDirectory=/app
ExecStart=/usr/bin/node index.js
[Install]
WantedBy=multi-user.target
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question