Late 19th Century Moscow, Petersburg, The Russian Countryside
First and foremost, Anna Karenina is a Russian novel. It's not just that the characters happen to be Russian, dress in furs, eat caviar, and drink vodka. More than that, the characters we meet are interested in their Russian-ness, and they debate what it means to be Russian.
History lesson time, Shmoopers. We promise—this will totally augment your understanding of the brilliant Anna Karenina:
19th Century Russia: A Total Powderkeg
Most crucial is the novel's setting in late 19th Century Russia. This was a time of insane amounts of intellectual fervor and debate about what direction Russia should take in becoming a modern nation. By the late 19th century, Russia was preoccupied in proving thatt it could be as advanced as the rest of Europe. This sparked a huge debate over how much Russia should try to Europeanize itself and how much it needed to hang onto its own traditional values.
At the same time, Russia was also dealing with huge economic and political issues. While Western countries were beginning to democratize, Russia was still an empire run by an all-powerful Czar. Russia's wealth was concentrated in the hands of a few wealthy nobles, but the vast majority of Russians were peasants who had been using the same farming techniques for hundreds of years. There were plenty of people who thought this situation was bad news, but there were lots of conflicting opinions on what should be done.
Some radicals suggested a violent overthrow of the tsar and the nobles. Other reformers wanted to try to solve the problem by making Russia more productive agriculturally. Potential reformers often ran into trouble (like Levin does) in trying to teach the peasants new ways to farm. Some intellectuals looked to Western democracies to provide examples for Russia's future; they argued that education and modernization were essential.
Others dreamed of embracing a new social life based on ancient (and perhaps fictitious) Russian communal villages. Add to the mix traditional Orthodox Christianity and new stirrings of atheism, and you have a time period that would prove to be literally explosive. Remember that the Russian Revolution came only a few decades after Tolstoy wrote Anna Karenina. This time period emerges clearly in the novel, because characters constantly discuss hot intellectual topics like industrialization, spirituality, agriculture, the peasantry, and the role of women.
Ye Olde City Mouse Vs. Country Mouse Debate
Tolstoy illustrates the different facets of 19th century Russia through the different physical settings of the novel. Setting matters a lot in Anna Karenina. The lives of the characters—especially their moral lives—are affected by their surroundings. Levin only feels comfortable in the countryside, because the country embodies traditional Russian values like purity, hard work, and religiosity. Oblonsky is happiest in town, but when Levin stays in town for a long time he starts drinking, gambling and falling for women other than his wife. As soon as he heads back to the countryside, of course, Levin becomes a good guy again.
The two cities of the novel also each have their own character. Moscow is traditional, conservative, and "Old Russia"; Petersburg is fashionable and hedonistic. Petersburg represents the "New Russia" shaped by European influences—which Tolstoy often views as a bad thing.