Run as a Service (Linux)
To ensure Planka runs persistently across reboots, we use PM2, a process manager for Node.js applications.
Step-by-Step Instructions
- Install PM2 Globally
sudo npm install pm2@latest -g
- Navigate to the Planka Directory
cd /var/www/planka
- Start Planka with PM2
pm2 start --name "planka" "npm run db:init && npm start --prod"
This registers Planka as a PM2 process named
planka
.
- Configure PM2 to Launch on Boot
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u planka --hp /home/planka
- Save the Current PM2 Process List
pm2 save
Now Planka will automatically start after system reboots.