RS485 Common Ground: Common Voltage or Common Wire or Both?
You have basically two questions in one.
1. Common ground
With 1000m between the nodes it is practically unavoidable to have ground potential out of transceiver's common mode range at some point. Therefore, you need at least one more conductor in your wiring for common ground. This, however, creates ground loop problems. So, you have to make environmental assessment first:
a) If this is permanent indoor installation then TIA/EIA-485-A recommended solution is to connect common ground wire to local ground at each node with 100 Ohm resistor.
b) If this is outdoor installation and especially if hot-plugging of the network nodes is expected, then isolated transceivers should be used, with common wire grounded at one side only.
I strongly recommend reading the RS-485 Design Guide by Texas instruments. Unfortunately, TIA standards are not free, but here you can find very good overview of the key points in TIA-485.
2. Power Supply
I am not sure what you mean when you say "ensure a 5v ground on both ends". A ground is a ground and 5V is 5V. In this context 5V is a supply voltage referenced to the ground. Since you have to run common ground wire between the nodes anyway (see above), an obvious solution would be to add one more conductor with power supply for all the nodes. But this is not a practical solution. The voltage drop and power losses over 1000m will be huge.
So, now again you need to make an assessment of how your network will be actually used:
a) If you go with non-isolated network (case 1.a above) and your nodes require very little current (like various sensors, for example) then one common solution is to have higher voltage power supply line along with data and ground wires. Inject 12-24V at single point and then use POL converters to bring it down to 5V at each node.
b) If you go with non-isolated network but your nodes require local power supplies anyway, then there is no point in added costs of central power distribution. Simply power nodes and their transceivers from local power supplies.
c) In case of isolated network (case 1.b) use isolated transceivers with built-in power converters, like MAXM22511 for example.
The RS485 tranceivers need to have a common ground reference that does not differ more than 7V.
1) Right, if you power the remote end from the local end, the supply return wire (i.e. the only ground between devices) will have voltage drop based on max wire resistance and max current flow, you can estimate voltage difference between grounds, it must be below 7V for RS485 for proper operation.
2) If both ends are powered with supplies that have floating outputs, i.e. have no reference to each other via mains or earthing, then you also need a ground wire between RS485 tranceivers to keep voltage between supply grounds equal. But as it is not used for supply voltage currents, there will be almost no current flowing (except supply leakage) so it just keeps the RS485 tranceivers at the same potential. If, however, both power supplies have their output referenced to local mains earth, then connecting the RS485 ground wire between them causes a current loop as it tries to equalize earth potentials between the devices. So at least one of the supplies must have it's output floating, like USB chargers do.
3) Supply voltage does not matter, if the return current still travels via ground wire between devices, creating a voltage drop. But if you a separate run supply return wire, you can use an isolated DC/DC converter at the remote end to create a local supply, and use a ground reference wire where no current flows between RS485 tranceivers.
4) The RS485 bus should have a ground reference which is at 0V everywhere so no current flows in that wire. It is conceptually different from a ground wire of powered chip or device which is just a return path for supply currents and because of current that ground wire has potential difference over it. But for RS485, it tolerates 7V of difference, so in general, supply ground return wire can be used as RS485 ground reference until difference between grounds grow over 7V between boards, devices, or buildings, so topology is defined by distance and currents.