Tramp will run whatever commands you want to run on remote server if you're running commands with `M-!`
I use it for work sometimes, that + vterm and ssh makes for a fairly pleasant remote editing experience in emacs. LSP even works over tramp (kinda)