With the popularity of the internet, cyberbullying has emerged as an increasingly serious social issue, particularly affecting college students’ behavioral health. This study explores the relationship between perceived discrimination and cyberbullying, as well as the mediating role of self-esteem and the moderating role of self-compassion (SC) in this relationship. Using a longitudinal design, data were collected from 892 Chinese college students (414 females, 478 males) in two waves spanning 1 year. The present study measured the compassionate self-responding (CS) and reduced uncompassionate self-responding (RUS) as the two dimensions of self-compassion. The study found that (1) perceived discrimination was significantly and positively correlated with cyberbullying (r = 0.085, p < 0.05); (2) self-esteem mediated the relationship between perceived discrimination and cyberbullying (Indirect effect = 0.010, SE = 0.004, Boot 95% CI [0.003, 0.019]); (3) RUS moderated both the direct relationship between perceived discrimination and cyberbullying (b = −0.045, SE = 0.019, 95% CI [−0.082, −0.008]) as well as the indirect relationship through self-esteem (b = −0.081, SE = 0.033, 95% CI [−0.146, −0.015]). Simple slope analysis revealed that college students with high RUS exhibited less cyberbullying when facing discrimination, while those low in RUS were more likely to engage in cyberbullying. The SC exhibited similar moderating effects, but CS did not demonstrate significant moderating effects in those relationships. This study sheds light on the complex interplay between perceived discrimination, self-esteem, self-compassion, and cyberbullying and offers novel insights into the psychological mechanisms underlying cyberbullying among college students. The findings underscore the importance of interventions aimed at enhancing self-esteem and fostering self-compassion, particularly by addressing uncompassionate self-responding, as a strategy to prevent cyberbullying among disadvantaged college students.