Background: Poor sleep quality is usually experienced by someone with quite heavy activities such as farmers who have to get up early to go to the fields, plants and harvest rice. This study aims to analyze mental health and psychosocial factors that influence the sleep quality of Indonesian farmers. Methods: This study uses analytic correlation with a cross-sectional approach. The sample of this research is 84 farmers from 107 populations. Sampling using the Simple Random Sampling technique. Retrieval of data using a questionnaire. The variables are age, gender, health status, medication, lifestyle, stress level and environment. Sleep quality data were obtained using the Pittsburgh Sleep Quality Index (PSQI) questionnaire and data analysis using the chi-square statistical test . Result: The results showed that in the variables of health status (p = 0.000), environment ( p= 0.000), age (p= 0.002), drugs use (p = 0.006), stress level (p= 0.028), then gender (p= 0.8) and lifestyle (p= 0.063). So, it can be concluded that quality has the most influence, namely health status, environment, medicines, and stress levels. There is no relationship between gender and lifestyle with sleep quality. Conclusion:Farmers are expected to be able to control psychosocial factors that affect sleep quality, for health workers it is expected to be more effective in approaching health education counseling in the local area regarding maintaining sleep needs and psychosocial factors that can affect farmers' sleep quality.