Local energy communities are forming as a way for prosumers and consumers to invest in distributed renewable energy sources, community storage and share electricity. Meanwhile, several distribution grids have voltage problems at certain hours of the year. Local energy communities consisting of generation and storage units might be valuable flexible assets that the distribution system operator (DSO) can make use of. This article aims to study how a battery in an energy community can provide services to the distribution grid, by creating a linear optimisation model which includes power flow constraints and a battery degradation model. First, we investigate how the battery operation of an energy community impacts the voltage in the nearby buses. We find that when including the degradation model, the voltage limits are violated much less than when not including the degradation model. Next, we investigate how the battery operation differs when the energy community cooperates with an active DSO to share the battery use, and quantify how much the DSO should remunerate the energy community. We find that the energy community should get 15 \euro per year due to an increase in electricity and degradation costs, which equals an increase of 0.12%, compared to when the community is not providing a service. Finally, a sensitivity analysis is performed to determine which parameters are more important to consider. We find that voltage violations in the grid are sensitive to the battery replacement cost, electric vehicle charging peak and the average spot price, while the remuneration from the DSO is sensitive to the battery replacement cost. For small battery sizes and a low power-to-energy ratio, the community is not able to improve the voltage at all hours of the year.