Cannabidiol (CBD), the second most abundant of the active compounds found in the Cannabis sativa plant, is of increasing interest because it is approved for human use and is neither euphorizing nor addictive. Here, we design and synthesize novel compounds taking into account that CBD is both a partial agonist, when it binds to the orthosteric site, and a negative allosteric modulator, when it binds to the allosteric site of the cannabinoid CB2 receptor. Molecular dynamic simulations and site-directed mutagenesis studies have identified the allosteric site near the receptor entrance. This knowledge has permitted to perform structure-guided design of negative and positive allosteric modulators of the CB2 receptor with potential therapeutic utility.