To resolve the growing problem of drug resistance in the treatment of bacterial and fungal pathogens, specific cellular targets and pathways can be used as targets for new antimicrobial agents. Endogenous riboflavin biosynthesis is a conserved pathway that exists in most bacteria and fungi. In this review, the roles of endogenous and exogenous riboflavin in infectious disease as well as several antibacterial agents, which act as analogues of the riboflavin biosynthesis pathway, are summarized. In addition, the effects of exogenous riboflavin on immune cells, cytokines, and heat shock proteins are described. Moreover, the immune response of endogenous riboflavin metabolites in infectious diseases, recognized by MHC-related protein-1, and then presented to mucosal associated invariant T cells, is highlighted. This information will provide a strategy to identify novel drug targets as well as highlight the possible clinical use of riboflavin.