Sleep problems and impulsivity frequently occur in methamphetamine (MA) abstainers and are linked to aberrant brain function. However, the interplay between these factors remains poorly understood. This study aimed to investigate the relationship between sleep, impulsivity, and regional homogeneity (ReHo) through mediation analysis in MA abstainers. 46 MA abstainers and 44 healthy controls were included. Impulsivity and sleep problems were evaluated using the Barratt Impulsivity Scale and the Pittsburgh Sleep Quality Scale, respectively. ReHo, indicative of local brain spontaneous neural activity, was assessed using resting-state functional magnetic resonance imaging. Results unveiled correlations between different dimensions of impulsivity and ReHo values in specific brain regions. Motor impulsivity correlated with ReHo values in the left postcentral gyrus and left precentral gyrus, while non-planning impulsivity was only associated with ReHo values in the left precentral gyrus. Additionally, the need for sleep medications correlated with ReHo values in the left precentral gyrus and bilateral postcentral gyrus. Also, the need for sleep medications was positively correlated with cognitive impulsivity and motor impulsivity. Mediation analysis indicated that reduced ReHo values in the left precentral gyrus mediated the association between impulsivity and the need for sleep medications. These findings imply that addressing sleep problems, especially the need for sleep medications, might augment spontaneous neural activity in specific brain regions linked to impulsivity among MA abstainers. This underscores the importance of integrating sleep interventions into comprehensive treatment strategies for MA abstainers.