Recent studies have highlighted the capacity of marine diatoms at the foundation of ocean food webs and biogeochemical cycles to respond to environmental change. These responses are a combination of physiological acclimation and evolutionary responses. The latter occur rapidly within a few hundred generations (translating to a scale of months to years), due to the large standing genetic variation and short generation times of diatom populations. Studies are usually carried out on diatom species in their planktonic state, but this may constitute a stark oversimplification: diatoms readily form biofilms in the water column of shallow coastal areas, where biofilm formation affects carbon export, and in the benthos, where biofilms contribute significantly to sediment stability. Here, I have carried out a 400‐generation selection experiment, where I evolved the diatom Thalassiosira pseudonana and its associated bacteria. Bacteria and diatom were cultured in their planktonic form, and under strong selection for rapid biofilm formation in temperature and nutrient regimes differing in their severity and stability. I find that biofilm formation is enhanced under mild warming and rapid thermal fluctuations but not under extreme warming regardless of nutrient availability. Evolutionary responses are slower in biofilms under benign conditions but speed up under extreme and fluctuating conditions. Taxonomic composition of the associated bacteria is driven by the temperature selection regime in biofilms but not in planktonic samples. I also show that T. pseudonana, when selected for biofilm formation, presents predictable and sequential morphologies that are not usually observed in planktonic T. pseudonana.