I created an Amazon Lightsail Instance of 512MB RAM,
I have got all my production server files installed on my Amazon Lightsail Instance. Then I connected to the instance via SSH.
Then I ran my database command in the background via the browser SSH window:
mongod --dbpath=data &
Then I ran my server command in the background:
next start -H <private_ip> -p <port>
Then I closed the browser ssh window. Then, after some time I found that the server was not able to be reached via the url.
It was working when I had the ssh window open.
I opened the ssh window again, and did ps
to see if the processes were still running. I found that both the database process and the server process were closed.
I want them to persist forever, i.e. the processes shouldn't close because I want to use my website at any time right.
Will try it out thanks !
Alternatively, use "&" to disconnect the process from the login session.
'nohup yourprocess &'