RamR is a transcriptional repressor of the gene-encoding RamA protein, which controls the expression of the multidrug efflux system genes acrAB-tolC. RamR is an important multidrug-resistance factor, however, its structure and the identity of the molecules to which it responds have been unknown. Here, we report the crystal structure of RamR in complex with multiple drugs, including berberine, crystal violet, dequalinium, ethidium bromide and rhodamine 6G. All compounds are found to interact with Phe155 of RamR, and each compound is surrounded by different amino acid residues. Binding of these compounds to RamR reduces its DNA-binding affinity, which results in the increased expression of ramA. Our results reveal significant flexibility in the substrate-recognition region of RamR, which regulates the bacterial efflux participating in multidrug resistance.