The Stranger by Albert Camus was set in French North Africa. The novel was published in 1942, at which time Algeria was still under French rule and World War II was ravaging Europe. While certain members of the local elites benefited greatly from French rule, many people in the nation resented the French, leading to the Algerian War of Independence in the 1950s, and eventually to independence in 1962.
The protagonist of the novel, Mersault, is a Frenchman living in Algeria, of a sort that was often called "pieds-noir" (black feet), an ethnic European who was raised and lived in Algeria, and was neither fully part of French nor of African culture. Part of the alienation felt by the character has to do with this uncertain identity.
Geographically, the novel is set in Algiers, the largest city of Algeria, which is located on the southern coast of the Mediterranean Sea. The main events take place in the city, by the seaside, and in the jail where Mersault ends up after killing an Arabic man.
The setting of The Stranger is Algiers, in French Algeria (North Africa), in the 1940s (it was published in 1942). The region had been a French colony for almost a century, and the discriminatory attitude of the French toward the Arabs in the book is manifest throughout. For example, Mersault is not sentenced to death over outrage for the murder of the Arab, but rather for his apparent callousness in response to his mother's death. The setting and especially the time are also crucial to the tone of the novel. Part of France was occupied by the Nazis, with the other part under collaborationist Vichy rule. War raged between the Germans and the Allies in North Africa. In this atmosphere, Camus's meditations on the absurdity and indifference of the world to human suffering were particularly powerful.