Due to the great renewable integration capability of Microgrids (MG), reliability, resiliency and stability improvement, MGs play a crucial role in the next generation of electrical power networks. Besides, MGs provide significant potential economic and environmental benefits. However, the intermittent nature of renewable sources necessitates utilising energy storage devices, which would impose new challenges to the energy management of MGs. This paper proposes a centralised optimal power flow controller to minimise the operation cost of distributed microgrid systems while satisfying the technical constraints, considering the battery energy storage depreciation, transmission losses, and dispatchable units' characteristics. Due to the extensive computational time required to solve the nonlinear optimisation problem, the distributed microgrid system is formulated as a Mixed Integer Linear Problem. To investigate the performance and functionality of the proposed approach, it is applied to an actual case study at Griffith University, consisting of four MGs. The obtained results confirm the cost-effectiveness and applicability of the proposed model and control approach.