BACKGROUND: Happiness has been of importance in different cultures because of its importance for biopsychosocial development in humans. Therefore, it is relevant to identify factors that can promote happiness, such as optimism, gratitude, mental health and psychological well-being. This study's aim was to test predictors of happiness in a Mexican sample. METHOD: A nonexperimental and cross-sectional design was used, as well as a non-probabilistic sampling method. Four scales were applied to measure optimism, gratitude, psychological well-being, and happiness in 250 Mexican participants, as well as mental and physical health self-assessments. Descriptive analysis, hierarchical regression models, path analysis and multigroup analysis were used. RESULTS: The hierarchical regression model obtained an explained variance of 57.4 %, while the structural model was 31.53 %. It was observed that a higher degree of gratitude predicted psychological well-being and happiness, while a higher optimism predicted a higher psychological well-being (β = 0.231, p = .001), mental health (β = 0.255, p = .001) and happiness (β = 0.518, p = .001). Multigroup analysis identified differences in these effects, where participant sex, marital status and religion were moderating variables. CONCLUSIONS: The identification of the mediating and moderating variables of the direct and indirect effects of happiness will allow the development of intervention strategies to promote happiness in the population.