The narrative opens in the decade before World War I. We are introduced to the central protagonist of the story, Hans Castorp, the only child of a Hamburg merchant family who, following the early death of his parents, has been brought up by his grandfather and subsequently by an uncle named James Tienappel. We encounter him when he is in his early 20s, about to take up a shipbuilding career in Hamburg, his home town. Just before beginning this professional career Castorp undertakes a journey to visit his tubercular cousin, Joachim Ziemssen, who is seeking a cure in a sanatorium in Davos, high up in the Swiss Alps. In the opening chapter, Hans is symbolically transported away from the familiar life and mundane obligations he has known, in what he later learns to call "the flatlands", to the rarefied mountain air and introspective little world of the sanatorium.
Castorp's departure from the sanatorium is repeatedly delayed by his failing health. What at first appears to be a minor bronchial infection with slight fever is diagnosed by the sanatorium's chief doctor and director, Hofrat[nb 1] Behrens, as symptoms of tuberculosis. Hans is persuaded by Behrens to stay until his health improves.
During his extended stay, Castorp meets and learns from a variety of characters, who together represent a microcosm of pre-war Europe. These include the Italian secular humanist and encyclopedist Lodovico Settembrini (a student of Giosuè Carducci), the totalitarian Jew-turned-Jesuit Leo Naphta, the dionysian Dutch Mynheer Peeperkorn, and his romantic interest Madame Clavdia Chauchat.
In the end, Castorp remains in the morbid atmosphere of the sanatorium for seven years. At the conclusion of the novel, the war begins, Castorp volunteers for the military, and his possible, or probable, demise upon the battlefield is portended.