Addiction to drugs is a chronic, relapsing brain disease that has major medical, social, and economic complications. It has been established that genetic factors contribute to the vulnerability to develop drug addiction and to the effectiveness of its treatment. Identification of these factors may increase our understanding of the disorders, help in the development of new treatments and advance personalized medicine. In this review, we will describe the genetics of the major genes of the opioid system (opioid receptors and their endogenous ligands) in connection to addiction to opioids, cocaine, alcohol and methamphetamines. Particular emphasis is given to association and functional studies of specific variants. We will provide information on the sample populations and the size of each study, as well as a list of the variants implicated in association with addiction-related phenotypes, and with the effectiveness of pharmacotherapy for addiction.