Protein N-glycosylation is a widespread post-translational modification. The first committed step in this process is catalysed by dolichyl-phosphate N-acetylglucosamine-phosphotransferase DPAGT1 (GPT/E.C. 126.96.36.199). Missense DPAGT1 variants cause congenital myasthenic syndrome and disorders of glycosylation. In addition, naturally-occurring bactericidal nucleoside analogues such as tunicamycin are toxic to eukaryotes due to DPAGT1 inhibition, preventing their clinical use. Our structures of DPAGT1 with the substrate UDP-GlcNAc and tunicamycin reveal substrate binding modes, suggest a mechanism of catalysis, provide an understanding of how mutations modulate activity (thus causing disease) and allow design of non-toxic "lipid-altered" tunicamycins. The structure-tuned activity of these analogues against several bacterial targets allowed the design of potent antibiotics for Mycobacterium tuberculosis, enabling treatment in vitro, in cellulo and in vivo, providing a promising new class of antimicrobial drug.