How do I use tmux to keep programs running?

You can use the program tmux to keep programs and commands running after you log out of a server or Cloud instance. This is useful, for example, when copying a large amount of data directly between servers or Cloud instances using rsync.

To use tmux, first install tmux on the server or Cloud instance by running:

sudo apt -y update && sudo apt -y install tmux

Then, run the command tmux to create a tmux session. In the tmux session, run commands like you normally would.

When you’re ready to log out of the server or Cloud instance, press Ctrl + b, then press d. You’ll “detach” from the tmux session and can safely log out of the server or Cloud instance.

To reattach to the tmux session, first log into the server or Cloud instance. Then, run tmux attach.