In this study, the Indium doped Ti/PbO2 electrode (marked as Ti/In-PbO2) was prepared via simple electrodeposition technology for electrochemical degradation of cefalexin (CLX). To obtain the effect of Indium on the electrochemical activity and stability of Ti/PbO2 electrode and optimize the doping amount of Indium, the morphology, crystal structure, element state, electrochemical activity and stability of Ti/In-PbO2 electrodes with different Indium amounts were analyzed by scanning electron microscopy (SEM), X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS), fluorescence spectroscopy, linear sweep voltammetry (LSV), cyclic voltammetry (CV), chronoamperometry (CA), electrochemical impedance spectroscopy (EIS) and Tafel curve. The results showed that when the InNO3 concentration in electrodeposition solution was 15 mM/L, the Ti/In-PbO2 electrode possessed the best electrocatalytic activity and the highest stability due to its denser structure, finer grains, larger specific surface area, and stronger ability to generate hydroxyl radicals. The electrochemical degradation rate constant of CLX at Ti/In-PbO2 anode was 1.93 times faster than that at pristine Ti/PbO2 electrode. Additionally, the influence of current density, initial pH, initial CLX concentration and electrolyte concentration on removal efficiency of CLX was investigated and the degradation pathway of CLX was proposed.