A reduction in the volume of the thalamus and its nuclei has been reported in Alzheimer's disease, mild cognitive impairment and asymptomatic individuals with risk factors for early-onset Alzheimer's disease. Some studies have reported thalamic atrophy to occur prior to hippocampal atrophy, suggesting thalamic pathology may be an early sign of cognitive decline. We aimed to investigate volumetric differences in thalamic nuclei in middle-aged, cognitively unimpaired people with respect to dementia family history and apolipoprotein ε4 allele carriership and the relationship with cognition. Seven hundred participants aged 40-59 years were recruited into the PREVENT Dementia study. Individuals were stratified according to dementia risk (approximately half with and without parental dementia history). The subnuclei of the thalamus of 645 participants were segmented on T1-weighted 3 T MRI scans using FreeSurfer 7.1.0. Thalamic nuclei were grouped into six regions: (i) anterior, (ii) lateral, (iii) ventral, (iv) intralaminar, (v) medial and (vi) posterior. Cognitive performance was evaluated using the computerized assessment of the information-processing battery. Robust linear regression was used to analyse differences in thalamic nuclei volumes and their association with cognitive performance, with age, sex, total intracranial volume and years of education as covariates and false discovery rate correction for multiple comparisons. We did not find significant volumetric differences in the thalamus or its subregions, which survived false discovery rate correction, with respect to first-degree family history of dementia or apolipoprotein ε4 allele status. Greater age was associated with smaller volumes of thalamic subregions, except for the medial thalamus, but only in those without a dementia family history. A larger volume of the mediodorsal medial nucleus (Pfalse discovery rate = 0.019) was associated with a faster processing speed in those without a dementia family history. Larger volumes of the thalamus (P = 0.016) and posterior thalamus (Pfalse discovery rate = 0.022) were associated with significantly worse performance in the immediate recall test in apolipoprotein ε4 allele carriers. We did not find significant volumetric differences in thalamic subregions in relation to dementia risk but did identify an interaction between dementia family history and age. Larger medial thalamic nuclei may exert a protective effect on cognitive performance in individuals without a dementia family history but have little effect on those with a dementia family history. Larger volumes of posterior thalamic nuclei were associated with worse recall in apolipoprotein ε4 carriers. Our results could represent initial dysregulation in the disease process; further study is needed with functional imaging and longitudinal analysis.