This dataset contains data from a termite immunity related study described in the paper: “He Shulin, Sieksmeyer Thorben, Che Yanli, Mora M. Alejandra Esparza, Stiblik Petr, Banasiak Ronald, Harrison Mark C., Šobotník Jan, Wang Zongqing, Johnston Paul R. and McMahon Dino P. 2021Evidence for reduced immune gene diversity and activity during the evolution of termitesProc. R. Soc. B.288:20203168.http://doi.org/10.1098/rspb.2020.3168”. The study investigates the evolution of termite molecular immune system: evolution of immune gene family along a constructed phylogeny, different individual immune response between three termite castes, a subsocial cockroach and a non-social cockroach, the caste specific expression of immune genes, different social immune response between a social termite species and a non-social cockroach species. In the first experiment, we de novo sequenced 18 cockroach and termite species, spanning the full spectrum of solitary and social lifestyles, including two solitary cockroach species, two species of subsocial Cryptocercus wood-feeding cockroaches and 14 termite species. We exploited a transcriptomic approach to compare the immune gene repertoire of these sequenced species. In the second experiment, we compared individual immune responses in a solitary cockroach, B. orientalis, a subsocial wood-feeding roach, Cryptocercus meridianus, and each caste of a social termite, Neotermes castaneus, following direct injection with heat-killed microbes. In the third experiment, we explored total gene expression differences between castes without immune challenge. In the fourth experiment, we studied gene expression changes in each caste of N. castaneus following colony exposure to immune-challenged nestmates, and compared these with gene expression changes in the solitary cockroach, B. orientalis, following group exposure to immune-challenged conspecifics. Main results of the experiments are that (1) immune gene families show contractions and expansions during temite evolution; (2) compared with cockroaches, termites showed weak individual immune response; (3) termites have caste-specific constitutive immunity; (4) Compared with cockroach, termite showed a stronger gene expression changes in response to a social immune challenge