Autophagy is a cellular process that targets proteins, lipids and organelles to lysosomes for degradation, but it has also been shown to combat infection with various pathogenic bacteria. In turn, bacteria have developed diverse strategies to avoid autophagy by interfering with autophagy signalling or the autophagy machinery and, in some cases, they even exploit autophagy for their growth. In this Review, we discuss canonical and non-canonical autophagy pathways and our current knowledge of antibacterial autophagy, with a focus on the interplay between bacterial factors and autophagy components.