This paper studies an ES sharing model where multiple buildings cooperatively invest and share a community ES (CES) to harness economic benefits from on-site renewable integration and utility price arbitrage. Particularly, we formulate the problem that integrates the optimal ES sizing, operation and cost allocation as a coalition game, which are generally addressed separately in the literature. Particularly, we address the fair expost cost allocation which hasn't been well studied. To overcome the computational challenge of computing the entire information of explicit characteristic functions (takes exponential time), we propose a fair cost allocation based on nucleolus by employing a constraints generation technique. We study the fairness and computational efficiency of the method through a number of case studies. The numeric results imply that the proposed method outperforms the Shapley approach and proportional method either in computational efficiency or fairness. Notably, for the proposed method, only a small fraction of characteristic functions (2.54%) is computed to achieve the cost allocation versus the entire information required by Shapley approach. With the proposed cost allocation, we investigate the enhanced economic benefits of the CES model over individual ES (IES) installation. We see the CES model provides higher cost reduction to each committed buildings. Moreover, the value of storage is obviously improved (about 1.83 times) with the CES model over the IES model.