PESolut / leaf-me

new and final mono repo for the leaf me system: Leaf-Me is a full-stack Uber Eats-style delivery platform designed for dispensaries. The app streamlines the process of placing, preparing, and delivering orders through multiple role-based interfaces
0 stars 0 forks source link

SET Pm2 to start on boot #11

Closed PESolut closed 1 month ago

PESolut commented 1 month ago

Set PM2 to start on boot

To ensure our application starts automatically when the server reboots, we need to configure PM2 to start on system boot. This process involves generating a startup script and saving the current PM2 process list.

Steps:

  1. Generate the startup script:

    pm2 startup

    This command will output a line of code that you need to run with sudo privileges. Copy and run that command.

  2. Save the current PM2 process list:

    pm2 save

    This command saves the current list of processes, so PM2 knows which applications to start on boot.

  3. Verify the setup: Reboot your system and check if your application starts automatically.

    sudo reboot

    After the system comes back online, check the status of your processes:

    
    pm2 list 

Originally posted by @PESolut in #4