There are several ways to achieve this:
nohup to run the command so that the process is immune to hang ups (log out).
nohup command > /path/to/log 2>&1 &
NOTE: the above runs command immune to
SIGHUP in the background and redirects
stderr to a file specified.
disown Basically this allows the process to run as a new session (
init / PID 1 as its parent) so that user logout doesn't affect it. You can read the manual for more information.
Run command/apps in a
screen session. I personally prefer
tmux. Technically it runs a server on the host (remote server), as long as the daemon does NOT die, all session information will be preserved.
NOTE: if you get disconnected, just ssh to the server again and run
tmux attach -t <target-session> to get back to the sessions. Use
tmux ls to list available sessions.