My assumption was that you ship the server software together with the desktop software, maybe could even be one file. So running the binary runs the server + open the UI, shutting everything down when the UI closes.
You can do something similar with Tauri in Rust, so you get a desktop application communicating via local http in just one binary.