Parasite local adaptation, the greater performance of parasites on their local compared with foreign hosts, has important consequences for the maintenance of diversity and epidemiology. While the abiotic environment may significantly affect local adaptation, most studies to date have failed either to incorporate the effects of the abiotic environment, or to separate them from those of the biotic environment. Here, we tease apart biotic and abiotic components of local adaptation using the bacterium Pseudomonas fluorescens and its viral parasite bacteriophage Φ2. We coevolved replicate populations of bacteria and phages at three different temperatures, and determined their performance against coevolutionary partners from the same and different temperatures. Crucially, we measured performance at different assay temperatures, which allowed us to disentangle adaptation to biotic and abiotic habitat components. Our results show that bacteria and phages are more resistant and infectious, respectively, at the temperature at which they previously coevolved, confirming that local adaptation to abiotic conditions can play a crucial role in determining parasite infectivity and host resistance. Our work underlines the need to assess host–parasite interactions across multiple relevant abiotic environments, and suggests that microbial adaption to local temperatures can create ecological barriers to dispersal across temperature gradients.