Immediately I apologize if something is not correctly stated in the title of the topic.
the essence is …
When I run the application on the server (ubuntu, debian…etc) … I open the command line and enter the command ./app and my application works when I close the command line - it close …
How to make my program work even then when I close command line or leave the server
?
You can deploy remote, so is no need to be on the remote machine (in fact this is the idea). You can work and test on your Unix/Linux machine and deploy on the destination machine. Read the documentation to see how.