The nucleus accumbens (NAc) is a primary brain reward region composed predominantly of medium spiny neurons (MSNs). In response to early withdrawal from repeated cocaine administration, de novo dendritic spine formation occurs in NAc MSNs. Much evidence indicates that this new spine formation facilitates the rewarding properties of cocaine. Early withdrawal from repeated cocaine also produces dramatic alterations in the transcriptome of NAc MSNs, but how such alterations influence cocaine’s effects on dendritic spine formation remain unclear. Studies in non-neuronal cells indicate that actin cytoskeletal regulatory pathways in nuclei have a direct role in the regulation of gene transcription in part by controlling the access of co-activators to their transcription factor partners. In particular, actin state dictates the interaction between the serum response factor (SRF) transcription factor and one of its principal co-activators, MAL. Here we show that cocaine induces alterations in nuclear F-actin signaling pathways in the NAc with associated changes in the nuclear subcellular localization of SRF and MAL. Using in vivo optogenetics, the brain region-specific inputs to the NAc that mediate these nuclear changes are investigated. Finally, we demonstrate that regulated SRF expression, in turn, is critical for the effects of cocaine on dendritic spine formation and for cocaine-mediated behavioral sensitization. Collectively, these findings reveal a mechanism by which nuclear-based changes influence the structure of NAc MSNs in response to cocaine.