Install Node.js LTS, Yarn, and other deps curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt update sudo apt install -y yarn nodejs nginx Install pm2 yarn global add pm2 pm2 install pm2-logrotate pm2 set pm2-logrotate:compress true pm2 set pm2-logrotate:TZ "America/Sao_Paulo" Make pm2 opens with system pm2 startup systemd Add pm2 app # Start app pm2 start --source-map-support npm --name "my-app" -- run "start:production" # Save current app list pm2 save Nginx Snippet # change the port for your app port location / { proxy_pass http://localhost:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }