This paper presents an integrated planning framework to optimally determine the location and allocation of renewable-based distributed generation (DG) units, energy storage systems (ESSs), and capacitor banks (CBs). This planning aim at improving the performance of electrical distribution systems (EDSs). In the proposed model, the cost of energy delivered by the substation and the investment costs are minimized. The environmental aspects are taken into account to obtain an efficient environmentally committed plan. The uncertainties due to PV generation and demand profile are considered via external uncertainty indexes in a deterministic environment. The proposed model is a mixed-integer nonlinear programming (MINLP) problem, which is recast to a mixed-integer linear programming (MILP) problem using appropriate linearization techniques. This approximated MILP model is implemented in the mathematical language AMPL, while the commercial solver CPLEX is used to obtain the global optimal solutions. The proposed model is validated by testing on a medium voltage distribution system with 135 nodes under different conditions and topologies.