Streams and rivers form dense networks, shape the Earth's surface and, in their sediments, provide an immensely large surface area for microbial growth. Biofilms dominate microbial life in streams and rivers, drive crucial ecosystem processes and contribute substantially to global biogeochemical fluxes. In turn, water flow and related deliveries of nutrients and organic matter to biofilms constitute major constraints on microbial life. In this Review, we describe the ecology and biogeochemistry of stream biofilms and highlight the influence of physical and ecological processes on their structure and function. Recent advances in the study of biofilm ecology may pave the way towards a mechanistic understanding of the effects of climate and environmental change on stream biofilms and the biogeochemistry of stream ecosystems.