Exposure to environmental contexts associated with drug use can induce cravings that promote continued use and/or relapse. Opioid abuse is marked by high relapse rates, suggesting that contextual memories formed during opioid use may be particularly strong. While it is known that reward-seeking behavior is controlled by the mesolimbic reward circuit, little is understood about how contextual memories are altered by drug use. The dorsal hippocampus (dHPC) is necessary for multiple types of contextual learning and the place-specific activity of CA1 place cells map out space in a given environment. Here we examined the neuronal representation of context as animals developed morphine-paired environmental associations using a conditioned place preference (CPP) paradigm. To investigate changes in the hippocampal encoding before, during, and after drug-pairing, we developed a virtual reality (VR) morphine CPP (Mor-CPP) paradigm and used in vivo two-photon calcium imaging to record the activity of CA1 pyramidal neurons. We found increased activity in rewarded contexts following real-time operant conditioning with water rewards, but not after Mor-CPP training, suggesting different neural encoding mechanisms for natural reinforcers and morphine.