Drug addiction is a complex and chronic disease that affects the brain and behavior, leading to an inability to control the use of substances. It is characterized by compulsive drug-seeking, drug use, and a strong desire to use the substance, as well as the development of tolerance and withdrawal. Microglia, a type of glial cell in the central nervous system (CNS), play a crucial role in maintaining the health and function of the CNS. Accumulating evidence indicates that microglia play an important role in the progression of drug addiction. From a neuroimmunopharmacological perspective, herein we discuss the role and underlying mechanisms of microglia and potential therapeutic strategies by targeting microglia for drug addiction, and the limitations of the research on microglia in drug addiction.