This paper uses a reactive power control optimization algorithm to present an inverter-based photovoltaic generation system for increasing the distribution grid host capacity. The main objective of this study is to regulate bus voltages by providing sufficient minimal reactive power consumption, which is obtained by a Particle Swarm Optimization-based optimization algorithm. A modeling study of the system network is developed using DIgSILENT PowerFactory, and the control algorithm is implemented in MATLAB. The proposed approach is efficient for various scenarios of the IEEE 13-bus test system and practical distribution network. The analysis results are compared with outcomes from other control methods, including technical and economic assessments. The performance of the proposed optimization-based power system has shown that the proposed algorithm method yielded significantly superior mitigated voltage rises and increased hosting capacity compared to those achieved by existing control methods of a specific distribution network.