Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
544 views
in Technique[技术] by (71.8m points)

Start Next.js apps on Ubuntu server reboot with pm2

pm2 is really great for running my Next.js app on my Linode cloud server, running Ubuntu 20. However, I'm having a hard time figuring out how to run my Next.js apps on a system reboot.

What I have been doing is going in and using:

pm2 start npm --name "my app" --start manually.

So how do I have it run automatically on reboot?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Use pm2 startup to generate a Systemd service. Docs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...