Many pathogenic viruses rely on class I fusion proteins to fuse their viral membrane with the host cell membrane. To drive the fusion process, class I fusion proteins undergo an irreversible conformational change from a metastable prefusion state to an energetically more stable postfusion state. Mounting evidence underscores that antibodies targeting the prefusion conformation are the most potent, making it a compelling vaccine candidate. Here, we establish a computational design protocol that stabilizes the prefusion state while destabilizing the postfusion conformation. With this protocol, we stabilize the fusion proteins of the RSV, hMPV, and SARS-CoV-2 viruses, testing fewer than a handful of designs. The solved structures of these designed proteins from all three viruses evidence the atomic accuracy of our approach. Furthermore, the humoral response of the redesigned RSV F protein compares to that of the recently approved vaccine in a mouse model. While the parallel design of two conformations allows the identification of energetically sub-optimal positions for one conformation, our protocol also reveals diverse molecular strategies for stabilization. Given the clinical significance of viruses using class I fusion proteins, our algorithm can substantially contribute to vaccine development by reducing the time and resources needed to optimize these immunogens.