Just run docker compose on the remote machine (and copy the compose file with scp). I don’t see a lot of benefits if you run docker compose on another machine than the docker daemon. You can even automate it with ansible, terraform, or similar, if you like it neat.
Or just go with k8s if you need a more complex setup.
That is an entirely valid approach, but this way it feels like the server requires more maintainance. I can destroy a docker named volume through the lifecycle of the container. But I cant delete a system directory. (edit: I mean using `docker compose down -v` it deletes a named volume, but not a system directory)
Also, its really nice to be able to use `docker context use SERVER_NAME` so I can switch contexts (servers) very easily.
Or just go with k8s if you need a more complex setup.