regarding running terminal commands on vps (for e.g. “node server.js”) I can run those commands using putty via my pc, but when I close putty, the node closes too. Can it be that I close my putty and the node still continues to run?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You can do
screen -S node
and then execute your command.
Then, press control-d
After that, you can close putty.
If you want to go back to your screen session, do screen -r node
You can then do control-c to stop it, etc.
It depends on the kind of code you run. Some applications run inside your session, so when you disconnect, they stop. Others run on the background, and continue to do so if you disconnect.
Running “node server.js” is a command connected to your session, and it will stop once you disconnect. If that’s not what you want, you need to set up some kind of service or daemon that will run your for you after you disconnect.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.