Distributed generation systems (DGSs) are one of the key developments enabling the energy transition. DGSs provide users with increased control over their energy use and generation, but entail greater complexity in their design and operation. Traditionally, optimization models have been used to overcome this complexity, and currently, research is focusing on integrating uncertainties on them. This review attempts to analyze, classify and discuss 170 articles dealing with optimization of DGSs under uncertainty. A survey has been performed to identify the selected manuscripts and the strengths and weaknesses of previous reviews. As a result, an innovative classification has been designed and the distinct elements of optimization models in DGSs have been highlighted: microgrid architecture, sources of uncertainty, uncertainty addressing methods, problem types and formulations, objective functions, optimization algorithms and additional features. Each part is detailed thoroughly to provide an instructive overview of the research output in the area. Subsequently, several aspects of interest are discussed in depth: the future of dealing with uncertainty, the main contributions and trends, and the relative importance of the field. It is expected that this review will be of use to both experts and lay people to learn more about the current state of optimization models in DGSs and provide insights into how to further develop this field.