Phosphatidylinositol is critical for intracellular signalling and anchoring of carbohydrates and proteins to outer cellular membranes. The defining step in phosphatidylinositol biosynthesis is catalysed by CDP-alcohol phosphotransferases, transmembrane enzymes that use CDP-diacylglycerol as donor substrate for this reaction, and either inositol in eukaryotes or inositol phosphate in prokaryotes as the acceptor alcohol. Here we report the structures of a related enzyme, the phosphatidylinositol-phosphate synthase from Renibacterium salmoninarum, with and without bound CDP-diacylglycerol to 3.6 and 2.5 Å resolution, respectively. These structures reveal the location of the acceptor site, and the molecular determinants of substrate specificity and catalysis. Functional characterization of the 40%-identical ortholog from Mycobacterium tuberculosis, a potential target for the development of novel anti-tuberculosis drugs, supports the proposed mechanism of substrate binding and catalysis. This work therefore provides a structural and functional framework to understand the mechanism of phosphatidylinositol-phosphate biosynthesis.