During the heyday of the Old West drugs were pretty common and legal. The Chinese introduced opium when they came to America to build railroad lines. Drugs were not always used to get high, but to relieve pain.
The most popular painkillers were whiskey, morphine, opium, and laudanum. These could be purchased over the counter at any drugstore. Morphine was the most common narcotic on the frontier. It was first extracted in 1804 and was the first narcotic derived from a natural plant. It remains one of the most powerful pain relievers because it acts directly on the central nervous system. It’s also one of the most addictive. Too large a dose can be deadly. Commercial marketing began in the 1820s. After the invention of the hypodermic needle in 1853 its use expanded.
Morphine was hard to make and difficult to obtain so opium became the recreational drug of choice in the West for a century.
Prior to 1909 there were no restrictions on its import or use. It became a cure for morphine addiction. Opium dens operated in the Chinese section of town. They featured private rooms, couches, beds and even prostitutes.