The narrative opens in the decade before World War I. It introduces the protagonist, Hans Castorp, the only child of a Hamburg merchant family. Following the early death of his parents, Castorp has been brought up by his grandfather and, later, by a maternal uncle named James Tienappel. Castorp is in his early 20s, about to take up a shipbuilding career in Hamburg, his hometown. Before beginning work, he 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, Castorp leaves his familiar life and obligations, in what he later learns to call "the flatlands", to visit the rarefied mountain air and introspective small 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[a] Behrens, as symptoms of tuberculosis. Castorp is persuaded by Behrens to stay until his health improves.
During his extended stay, Castorp meets a variety of characters, who represent pre-war Europe in miniature. These include Lodovico Settembrini (an Italian humanist and encyclopedist, a student of Giosuè Carducci); Leo Naphta, a Jewish Jesuit who favors communistic totalitarianism; Mynheer Peeperkorn, a dionysian Dutchman; and his romantic interest, Madame Clawdia Chauchat.
Castorp eventually resides at the sanatorium for seven years. As the novel concludes, the war begins, and Castorp volunteers for the military. His possible demise upon the battlefield is portended.