Pairwise host–parasite relationships are typically embedded in broader networks of ecological interactions, which have the potential to shape parasite evolutionary trajectories. Understanding this ‘community context’ of pathogen evolution is vital for wildlife, agricultural and human systems alike, as pathogens typically infect more than one host—and these hosts may have independent ecological relationships. Here, we introduce an eco-evolutionary model examining ecological feedback across a range of host–host interactions. Specifically, we analyse a model of the evolution of virulence of a parasite infecting two hosts exhibiting competitive, mutualistic or exploitative relationships. We first find that parasite specialism is necessary for inter-host interactions to impact parasite evolution. Furthermore, we find generally that increasing competition between hosts leads to higher shared parasite virulence while increasing mutualism leads to lower virulence. In exploitative host–host interactions, the particular form of parasite specialization is critical—for instance, specialization in terms of onward transmission, host tolerance or intra-host pathogen growth rate lead to distinct evolutionary outcomes under the same host–host interactions. Our work provides testable hypotheses for multi-host disease systems, predicts how changing interaction networks may impact virulence evolution and broadly demonstrates the importance of looking beyond pairwise relationships to understand evolution in realistic community contexts.