Abstract Background Celecoxib is frequently prescribed to treat knee osteoarthritis (KOA), but how celecoxib influences the activity of the central nervous system to alleviate chronic pain remains unclear. Methods One hundred eight patients with KOA will be enrolled in this study. Patients will be allocated randomly to three groups: the celecoxib group, the placebo group, and the waiting list group. The patients in the celecoxib group will orally take celecoxib 200 mg once daily and the patients in placebo group with placebo 200 mg every day for 2 weeks. Functional magnetic resonance imaging scan will be performed on all patients at baseline and the end of interventions to detect the cerebral activity changes. The short form of McGill pain questionnaire and the Visual Analog Scale will be used as the primary endpoints to evaluate the improvement of knee pain. The secondary endpoints include the Western Ontario and McMaster osteoarthritis index (WOMAC), the Attention Test Scale, the Pain Assessment of Sphygmomanometer, the Self-rating Anxiety Scale, the Self-rating Depression Scale, and 12-Item Short Form Health Survey (SF-12). Discussion The results will investigate the influence of celecoxib treatment on cerebral activity of patients with KOA and the possible relationship between the cerebral activity changes and improvement of clinical variables so as to explore the central mechanism of celecoxib in treating knee pain. Trial registration ChiCTR-IOR-17012365. Registered on August 14, 2017.