This question already has an answer here:
I want to launch a task through ssh and then exit my terminal and have my task continuing on my ssh server.
I have tried a bunch of things which did not work, such as :
laptop$ ssh server@ipaddress server$ mytask &  12345 server$ logout
laptop$ ssh server@ipaddress server$ mytask (then hit [Ctrl]+[Z]) server$ logout
laptop$ ssh server@ipaddress -f "mytask" (and then close my terminal)
But even in my last attempt, closing my terminal would stop the task.
How should I proceed?
Thanks in advance!!