TRIM5α is a cytoplasmic restriction factor that blocks post-entry retroviral infection. Evidence suggests that its antiviral activity can be regulated by SUMO, but how this is achieved remains unknown. Here, we show that TRIM5α forms a complex with RanGAP1, Ubc9, and RanBP2 at the nuclear pore, and that RanBP2 E3 SUMO ligase promotes the SUMOylation of endogenous TRIM5α in the cytoplasm. Loss of RanBP2 blocked SUMOylation of TRIM5α, altered its localization in primary cells, and suppressed the antiviral activity of both rhesus and human orthologs. In cells, human TRIM5α is modified on K84 within a predicted phosphorylated SUMOylation motif (pSUM) and not on K10 as found in vitro. Non-modified TRIM5α lacked antiviral activity, indicating that only SUMOylated TRIM5α acts as a restriction factor. This work illustrates the importance of the nuclear pore in intrinsic antiviral immunity, acting as a hub where virus, SUMO machinery, and restriction factors can meet.