Although previous studies have confirmed the association between relative deprivation and individual health, the relationship between and underlying mechanisms of relative deprivation and sleep quality have rarely been explored. Therefore, the present study investigated how relative deprivation affected sleep quality by testing an integrated model and examining the roles of social anxiety and trait mindfulness. We surveyed 568 college students using the Relative Deprivation Scale, Interaction Anxiousness Scale, Mindful Attention Awareness Scale, and Pittsburg Sleep Quality Index. Data were analyzed using SPSS 24.0 and PROCESS macro for SPSS. We found that a high relative deprivation score predicted poor sleep quality, and social anxiety partially mediated this relationship. Our model also indicated that the relationship between relative deprivation and sleep quality via social anxiety was moderated by mindfulness. Specifically, increasing trait mindfulness may decrease the indirect effect of relative deprivation on sleep quality through social anxiety. The current study expands our understanding of the underlying mechanisms, paths, and conditions of the effects of relative deprivation on sleep quality. Furthermore, we provide additional evidence that trait mindfulness can mitigate the adverse effects of negative events. College students should consciously use trait mindfulness techniques to consider problems, reduce anxiety, and improve their sleep quality.