Background: Little is known about the relationship between shift work and perceived health, including potential underlying mechanisms such as unhealthy behaviors. The aim of this study was to investigate whether unhealthy behaviors mediate the relationship between shift work and perceived mental and physical health, taking into account potential differences by level of education. Methods: Data from 1633 workers participating in the Doetinchem Cohort Study during 1995–2016 were used. Being engaged in shift work was determined at 1 year preceding the assessment of health behaviors. Mental and physical health were assessed after 5 years of follow-up by the 5-item Mental Health Inventory and the physical functioning scale of the 36-item Short Form Health Survey. Smoking, physical inactivity, alcohol consumption, and overweight were considered as potential mediators and education was treated as moderator. Moderated mediation analyses using generalized estimated equations were performed. Results: Shift work was not statistically significantly related to either mental or physical health. Despite this, statistically significant mediation effects of smoking (Beta − 0.09; 95% Confidence Interval − 0.20 - -0.01, respectively B -0.09; 95%CI -0.21 - -0.01) and physical inactivity (B 0.11; 95%CI 0.03–0.23, respectively B 0.08; 95%CI 0.01–0.18) were found in the relationship between shift work and mental or physical health. Direct and indirect effects outweighed each other in the relationship between shift work and mental health, since the direction of these effects was opposite. The relationship between shift work, unhealthy behavior, and health was not different by educational level. Conclusion: Shift workers did not report lower mental or physical health than non-shift workers. Though mediation effects of unhealthy behavior were observed in the relationship between shift work and perceived health, these small effects had minor public health relevance.