High penetration of distributed energy resources will bring extreme challenges to the existing centralized energy management approach as the system becomes much more decentralized than before. To address this issue, this paper proposes a fully distributed algorithm based on diffusion strategy to solve the optimal energy management. First, the optimal resource management is modelled as a social welfare maximization problem with considering the generation cost, users’ utility and network power losses. Then, a fully distributed algorithm is developed based on the diffusion strategy. By introducing a diffusion term, the information is diffused more thoroughly in the network. Moreover, theoretical analysis is present to show the impact of the control gain on the algorithm’s stability using eigenvalue perturbation theory. Compared with consensus strategy-based algorithm, the proposed control scheme is superior in terms of both stability and convergence speed. Finally, several simulation studies are conducted to verify the effectiveness of the proposed algorithm.