Herpesviruses cause severe diseases particularly in immunocompromised patients. Both genome packaging and release from the capsid require a unique portal channel occupying one of the 12 capsid vertices. Here, we report the 2.6 Å crystal structure of the pentameric pORF19 of the γ-herpesvirus Kaposi’s sarcoma-associated herpesvirus (KSHV) resembling the portal cap that seals this portal channel. We also present the structure of its β-herpesviral ortholog, revealing a striking structural similarity to its α- and γ-herpesviral counterparts despite apparent differences in capsid association. We demonstrate pORF19 pentamer formation in solution and provide insights into how pentamerization is triggered in infected cells. Mutagenesis in its lateral interfaces blocked pORF19 pentamerization and severely affected KSHV capsid assembly and production of infectious progeny. Our results pave the way to better understand the role of pORF19 in capsid assembly and identify a potential novel drug target for the treatment of herpesvirus-induced diseases.