With the rapid development of distributed renewable energy, energy storage system plays an increasingly prominent role in ensuring efficient operation of power system in local communities. However, high investment cost and long payback period make it impossible for prosumers to own the storage system. In this context, considering the complementarity of power generation and consumption behavior among different prosumers, this paper proposes an energy storage sharing framework towards a community, to analyze the investment behavior for shared storage system at the design phase and energy interaction among participants at the operation phase. Therefore, under the sharing mode that the operator invests and virtualizes physical storage system to provide virtual storage services for prosumers, this paper first establishes a two-stage optimization model. Based on a new storage sharing contribution rate index and asymmetric Nash bargaining model, a profit-allocation mechanism is designed. Then, combined with alternating direction method of multipliers, to achieve a mutual benefit and win-win situation. Finally, the above model is simulated by three buildings' realistic data, and the effectiveness of shared energy storage system is analyzed by using different technical and economic performance indexes. Additionally, the influence of battery cost, carbon tax, electricity price, and the uncertainties of renewable energy output power and load on shared storage system planning are also discussed. Numerical results show that, compared with personal energy storage scenario, the proposed storage sharing mechanism can achieve 6.09% cost savings, the self-consumption rate and self-sufficiency rate of renewable energy respectively increase by 5.01% and 5.21%, and all financial evaluation indexes have improved. In short, this paper can give practical guidelines for investors and prosumers to reasonably plan and share energy storage system, and provide realistic references for the government to effectively implement the shared energy storage.