Is the carbon footprint better if I host my own RPI instead of using a cheap virtual server somewhere ? Having a Raspberry on all the time will consume some electricity I gues...
If the energy of your server is green and the heat is reused, as some modern datacenters do, the only concern becomes EOL of hardware and how quickly they change it.
Otherwise, yeah, shared cloud vm is always more economic than single hosted hardware of any kind.