There are several ways to achieve this:
nohup
use nohup to run the command so that the process is immune to hang ups (log out).
For example: nohup command > /path/to/log 2>&1 &
NOTE: the above runs command immune to SIGHUP in the background and redirects stdout/stderr to a file specified.
setsid and disown
Use setsid and 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.
Recommended approach
Use tmux or screen
Run command/apps in a tmux or 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.