After viral entry and reverse transcription, HIV-1 proviruses that fail to integrate are epigenetically silenced, but the underlying mechanism has remained unclear. Using a genome-wide CRISPR/Cas9 knockout screen, we identified the host SMC5/6 complex as essential for this epigenetic silencing. We show that SMC5/6 binds to and then SUMOylates unintegrated chromatinized HIV-1 DNA. Inhibition of SUMOylation, either by point mutagenesis of the SMC5/6 component NSMCE2—a SUMO E3 ligase—or using the SUMOylation inhibitor TAK-981, prevents epigenetic silencing, enables transcription from unintegrated HIV-1 DNA and rescues the replication of integrase-deficient HIV-1. Finally, we show that blocking SMC5/6 complex expression, or inhibiting its SUMOylation activity, suppresses the establishment of latent HIV-1 infections in both CD4+ T cell lines and primary human T cells. Collectively, our data show that the SMC5/6 complex plays a direct role in mediating the establishment of HIV-1 latency by epigenetically silencing integration-competent HIV-1 proviruses before integration.