“This is the story of the great war that Rikki-tikki-tavi fought single-handed, through the bath-rooms of the big bungalow in Segowlee cantonment.”

Here, in “Rikki-Tikki-Tavi’s” opening line, Kipling establishes that the story will take place in a British cantonment in India. A “cantonment” is a permanent garrison or military camp. Colonialism plays an essential role in the text; its very setting is indicative of the presence of the British in India, and the ongoing conflict between the cobras and Teddy’s family reflects this.

“...every well-brought-up mongoose always hopes to be a house-mongoose some day and have rooms to run about in, and Rikki-tikki's mother (she used to live in the General's house at Segowlee) had carefully told Rikki what to do if ever he came across white men.”

Here, the narrator explains that Rikki-tikki is pleased with his new home because all mongooses long to live luxuriously with “white men” instead of remaining in the jungle. His excitement to trade his life in the wilderness for a life of domesticity and civilization is indicative of the difference Kipling sees between the supposedly uncivilized India and the supposedly civilized Britain, as well as what Kipling believes the people of India should want: the benefits of British rule. Kipling’s attributing this enthusiasm to Rikki-tikki offers a racist and idealized view of colonialism from the perspective of the colonizer.