Recent advances in power generation technologies using renewable energy resources, changes in utility infrastructure and government policies tend to increase the interest in a renewable-based distributed generation units (DGs) in a distribution system. To obtain reduced power loss, voltage deviation and improved bus voltage stability in distribution systems, it is mandatory to control optimal power flow of both active and reactive power. Therefore, optimal allocation of DGs and CBs plays a vital role in distribution systems performance enhancement. Where optimal allocation of DGs reduce active power loss and optimal allocation of capacitor banks (CBs) improve bus voltages. This paper proposes a salp swarm algorithm (SSA) for optimal allocation of DGs and CBs. The main aim of the proposed algorithm is to attain technical, economic and environmental benefits. The proposed algorithm is based on the salps swarming behavior in oceans when navigating and foraging. To assess the performance of the proposed SSA three different cases considered: optimal allocation of only DGs, only CBs and simultaneous DGs and CBs. The proposed algorithm is tested on IEEE 33 and 69 bus radial distribution systems. The simulated results illustrate the efficiency of the proposed algorithm when compared to other existing optimization algorithms. Also, the proposed algorithm has achieved technical benefits of reduced power loss, voltage deviation, and improved bus voltage stability, the economic benefit of reduced total electrical energy cost and environmental benefit of reduced emissions. © 2019 International Journal of Renewable Energy Research.