Run your app/server in the background with screen!

by Amit Biswas Posted Apr. 18, 2017

Before you start, make sure you know how to SSH to the server. Learn about that here.

If you are home (read: not connected to NYU wifi) you have to use NYU VPN). Scroll down the page to see the download link for the vpn client for your platform (Windows, Mac etc.). When the vpn client asks for the server address use vpn.nyu.edu and use your typical netid and password to authenticate.

So you have built your server side app in your language of choice. And you have configured it to bind to an available open port on the server. Now how do you keep it running in the background, so that it doesn't get killed when you close your ssh session or your network gets disconnected?

Solutions I will talk about here are not meant for production. But for development (ie. constantly starting and stopping application to test new code) is this perfect.

Nohup

Nohup deserves a mention because it is extremely simple to use and can turn any bash command into a daemon. It even writes outputs from commands to a file.

nohup shell-command &

Lets see an example:

Source: Nohup Linux 101 Hacks

Screen