Cognitive impairment is common in peripheral diseases such as chronic kidney disease (CKD). Kidney transplantation reverses cognitive impairment, indicating that cognitive impairment driven by CKD is therapeutically amendable. Yet, we lack mechanistic insights allowing targeted therapies. Using a combination of mouse models (including mice with neuron-specific IL-1R1 deficiency), single cell analyses (single nuclei RNA sequencing and single cell thallium automethallography), human samples and in vitro experiments we demonstrate that microglia activation impairs neuronal potassium homeostasis and impairs cognition in CKD. CKD conditions disrupt the barrier of brain endothelial cells in vitro and the blood-brain barrier in vivo, establishing that brain cells are exposed to uremic conditions. Exposure to uremic conditions impairs calcium homeostasis in microglia, enhances microglial potassium (K+) efflux via the calcium-dependent channel KCa3.1, and induces p38-MAPK associated IL-1β maturation in microglia. Restoring K+ homeostasis in microglia using a KCa3.1-specific inhibitor (TRAM34) improves CKD-triggered cognitive impairment. Likewise, inhibition of the IL-1β receptor 1 (IL-1R1) using anakinra or genetically abolishing neuronal IL-1R1 expression in neurons prevent CKD-mediated reduced neuronal potassium turnover and CKD-induced impaired cognition. Thus, in CKD mice impaired cognition can be ameliorated by either preventing microglia activation or inhibiting IL-1R-signaling in neurons. These data suggest that potassium efflux from microglia triggers their activation, which promotes microglia IL-1β release and IL-1R1-mediated neuronal dysfunction in CKD. This study provides new mechanistic insight into cognitive impairment in association with CKD and identifies possible new therapeutic approaches.