Ubiquitylation is a widespread post-translational protein modification in eukaryotes and marks bacteria that invade the cytosol as cargo for antibacterial autophagy1-3. The identity of the ubiquitylated substrate on bacteria is unknown. Here we show that the ubiquitin coat on Salmonella that invade the cytosol is formed through the ubiquitylation of a non-proteinaceous substrate, the lipid A moiety of bacterial lipopolysaccharide (LPS), by the E3 ubiquitin ligase ring finger protein 213 (RNF213). RNF213 is a risk factor for moyamoya disease4,5, which is a progressive stenosis of the supraclinoid internal carotid artery that causes stroke (especially in children)6,7. RNF213 restricts the proliferation of cytosolic Salmonella and is essential for the generation of the bacterial ubiquitin coat, both directly (through the ubiquitylation of LPS) and indirectly (through the recruitment of LUBAC, which is a downstream E3 ligase that adds M1-linked ubiquitin chains onto pre-existing ubiquitin coats8). In cells that lack RNF213, bacteria do not attract ubiquitin-dependent autophagy receptors or induce antibacterial autophagy. The ubiquitylation of LPS on Salmonella that invade the cytosol requires the dynein-like core of RNF213, but not its RING domain. Instead, ubiquitylation of LPS relies on an RZ finger in the E3 shell. We conclude that ubiquitylation extends beyond protein substrates and that ubiquitylation of LPS triggers cell-autonomous immunity, and we postulate that non-proteinaceous substances other than LPS may also become ubiquitylated.