In this study, the problem of finding an optimal location and size of a distributed generator (DG) in distribution systems with considering operational distribution system constraints is proposed with the objective of maximizing DG hosting capacity (MDHC), reducing system loss, and improving voltage stability index (VSI). The proposed objective function is formulated as a multi-objective mixed-integer nonlinear optimization in order to solve it simultaneously. To solve this problem, the coronavirus herd immunity optimizer (CHIO), a bio-inspired metaheuristic optimization method, is herein proposed to simultaneously tackle a discrete and continuous DG integration problem in distribution systems. Extensive simulations on an IEEE 69-node system with different load levels and DG numbers are performed using MATLAB software to evaluate the efficacy of the proposed method. The simulation results demonstrate that the proposed method efficiently improves overall distribution system performance when compared to different DG numbers and load levels. Furthermore, the CHIO optimization method shows encouraging results and almost obtains the best results in all proposed cases when compared with well-known metaheuristic optimization methods such as genetic algorithm (GA), the hunger games search (HGS), the chaotic neural network algorithm (CNNA), and the water cycle algorithm (WCA). The CHIO can successfully offer a notable solution for the DG integration problem, and the obtained results, for example in case 1, revealed outperforming the CHIO compared to other methods in terms of the MDHC (i.e., 99.999 %), voltage profile improvement (i.e., the minimum voltage magnitude of 0.9696 p.u), VSI improvement (i.e., 29.16 %), and system loss reduction (i.e., 66.95 %) compared with the base case, respectively.