The authors propose a two-stage sequential configuration method for energy storage systems to solve the problems of the heavy load, low voltage, and increased network loss caused by the large number of electric vehicle (EV) charging piles and distributed photovoltaic (PV) access in urban, old and unbalanced distribution networks. At the stage of selecting the location of energy storage, a comprehensive power flow sensitivity variance (CPFSV) is defined to determine the location of the energy storage. At the energy storage capacity configuration stage, the energy storage capacity is optimized by considering the benefits of peak shaving and valley filling, energy storage costs, and distribution network voltage deviations. Finally, simulations are conducted using a modified IEEE-33-node system, and the results obtained using the improved beluga whale optimization algorithm show that the peak-to-valley difference of the system after the addition of energy storage decreased by 43.7% and 51.1% compared to the original system and the system with EV and PV resources added, respectively. The maximum CPFSV of the system decreased by 52% and 75.1%, respectively. In addition, the engineering value of this method is verified through a real-machine system with 199 nodes in a district of Kunming. Therefore, the energy storage configuration method proposed in this article can provide a reference for solving the outstanding problems caused by the large-scale access of EVs and PVs to the distribution network.