This guide explains how to set up a Node.js server on an AWS Lightsail instance.
Move your project files to the appropriate directory (e.g., htdocs):
cp -r your-project /path/to/htdocs
cd /path/to/htdocs
Install the required packages:
sudo npm install
sudo npm install [email protected]
Install forever globally to keep your server running in the background:
sudo npm install -g forever
π‘ Note: If you are using forever programmatically, also install forever-monitor:
npm install forever-monitor
Navigate to your project directory and run the server:
cd /path/to/your/project
sudo forever start server.js