Abstract Background D-ribose is involved in the pathogenesis of Alzheimer’s Disease. The study aimed to determine the association between D-ribose and cognitive function in a sample of community-dwelling older adults. Methods A cross-sectional study was conducted in Chaoyang District, Beijing in 2019–2020. Eligible participants were community-based older adults aged 60 years and above. D-ribose was analyzed from the morning urine. Cognitive function, subjective cognitive decline, and depressive symptoms were measured by a battery of neuropsychological tests. Linear regressions were performed to determine the relationship between the urine D-ribose levels and cognitive performance. Results A sample of 1725 participants (67.1% female) aged 60 to 85 years (69.40 ± 5.87 years, mean ± SD) was enrolled in the analysis. The urine D-ribose concentrations ranged from 1.53 to 208.89 μmol/L (median 38.10 μmol/L; interquartile range 22.52—64.96 μmol/L). Higher levels of D-ribose were associated with worse performance on Mini-Mental State Examination and verbal fluency when age, gender, education, depressive symptoms, and cardiovascular risk factors were included as covariates. Conclusions The urine D-ribose was negatively correlated with cognitive function in community-dwelling older adults. The findings suggest that the dysmetabolism of D-ribose may play a role at the early stage of cognitive impairment.