A carpenter and heavy drinker named Jacob Engstrand pays his daughter Regine a visit one morning while she’s working as a maid for the wealthy Mrs. Alving. Engstrand has almost finished his work on the nearby orphanage, which Mrs. Alving has commissioned to commemorate the tenth anniversary of her husband’s death. The orphanage’s grand opening is the next day, and since his work is finished, Engstrand plans to return to his home in the nearby town. As he approaches the Alving household, Regine tells him to leave, not wanting anyone to see her speaking to him. Knowing that he’s an alcoholic, Regine doesn’t want to be associated with Engstrand, instead hoping to cultivate a sophisticated image. Ignoring her, Engstrand implores Regine to come home with him. He wants to open a hotel for sailors, he explains, and though he knows this sounds like a disreputable establishment, he claims that it will only accommodate captains and other distinguished guests. However, he also says that he wants Regine to give the hotel a womanly presence, adding that the sailors will want to have fun in the evenings. Appalled by the idea of leaving her life with the Alvings, Regine tells Engstrand to leave, and he chastises her for not being a dutiful daughter.
As Engstrand leaves, Pastor Manders comes to the Alving household to speak with Mrs. Alving about the orphanage. Pastor Manders is in charge of managing the orphanage’s finances, and he tells her that he doesn’t think they should purchase insurance for the building. This, he explains, is because buying insurance might make people think that they don’t trust God to protect the orphanage, and though he admits it’s a risky decision to make, he believes there’s simply no other option. Mrs. Alving agrees to forgo all insurance, though she mentions that there was a small fire in the orphanage just the day before, when a pile of wood shavings went up into flames where Engstrand was working. This troubles Manders, but he doesn’t dwell any longer on the topic of insurance, instead saying that Engstrand is a good man at heart even if he drinks too much and is careless.
Mrs. Alving’s son Oswald has recently come home for the first time in a long while, returning from Paris because he has become exhausted and unable to paint. As Pastor Manders and Mrs. Alving continue their conversation, Oswald enters and greets them both. Upon seeing the young man, Pastor Manders can’t believe his eyes because he hasn’t crossed paths with Oswald in many years, since Oswald left home at a young age. Despite the pastor’s friendliness, Oswald is hesitant to show good will toward Manders. Mrs. Alving explains that Oswald is still bitter about the fact that Manders judged him when he left home to become an artist. Quickly explaining himself, Manders insists that he no longer thinks all young artists are immoral, though he does have reservations about the unconventional lifestyles that many of them lead. Hearing this, Oswald tells him that he has never encountered any kind of immorality amongst his artist friends, saying that many of his close acquaintances have very loving homes and families despite the fact that they don’t have enough money to get married. This appalls Manders, who thinks that anyone who lives together should be married. Nevertheless, Oswald doesn’t take back what he has said, though he politely leaves Mrs. Alving and Pastor Manders to finish their conversation.
Once Oswald has left the room, Pastor Manders tells Mrs. Alving that he has something to say to her. He reproaches her for leaving her husband in the early stages of their marriage. Apparently, Mrs. Alving left Captain Alving shortly after their wedding because he was behaving like an alcoholic and an adulterer. Consequently, she went to Pastor Manders, but Manders insisted that she return home, believing that it’s a wife’s duty to remain by her husband regardless of the circumstances. Now, Pastor Manders praises himself for convincing her to go back to Captain Alving, since the man eventually dropped his wicked ways. Furthermore, he accuses Mrs. Alving of being a bad mother for sending Oswald away from home as a child, arguing that children should remain with their parents. Calling her selfish, he says that Mrs. Alving sent Oswald away because she couldn’t handle the pressures of motherhood. After listening to the pastor speak, Mrs. Alving informs him that he’s talking about things about which he knows very little. To illustrate this point, she reminds him that he stopped paying her and her husband visits shortly after she returned to Captain Alving, meaning that all of his opinions about their marriage are based on nothing but Captain Alving’s reputation. And this reputation, she reveals, doesn’t accurately represent who Captain Alving really was. The truth, she tells Manders, is that Captain Alving never reformed himself. In reality, he continued to drink heavily and sleep with other women, but Mrs. Alving helped him present himself as a respectable member of society.
Manders is beside himself when he hears that Captain Alving led a life of debauchery, but Mrs. Alving hasn’t even gotten to the worst part of her story. One day, she explains, she heard Captain Alving approach the maid, Johanna. Mrs. Alving was in the very room in which she and Manders now sit, and she heard Captain Alving make a sexual advance on Johanna. This astounds Manders, who can’t fathom the idea that Captain Alving would dare to do such things within the walls of his own home. Continuing her story, Mrs. Alving says that this was when she decided to send young Oswald away from home, fearing that Captain Alving would negatively influence the boy. From that point on, she didn’t let Oswald come home until after his father had died. Shortly after Mrs. Alving explains this, both she and Pastor Manders hear Oswald make a sexual advance on Regine in the adjacent room. Rattled, Mrs. Alving says that hearing this makes her feel like she’s confronting the ghosts of her past, and she reveals to Pastor Manders one final detail: Regine is the daughter of Johanna and Captain Alving.
After a tense dinner, Mrs. Alving and Pastor Manders return to the living room and resume their conversation. Mrs. Alving tells him that Captain Alving gave Johanna a large amount of money to lie about who impregnated her. Setting off to town, Johanna told Engstrand that a wealthy foreign sailor impregnated her and gave her money to keep quiet about it, and she ultimately convinced Engstrand to marry her and pretend to be Regine’s true father. In light of this, Mrs. Alving and Pastor Manders talk about the fact that Oswald has apparently taken a liking to his half-sister. To remedy this, Mrs. Alving and Pastor Manders brainstorm ways to send Regine out of the house, but can’t think of anywhere she can go, since Engstrand isn’t her true father. As they discuss this, Engstrand returns to the house and tells them that the orphanage is completely finished. Turning to Manders, he asks if the pastor would come stage a blessing ceremony in the new building, but Manders can’t contain his anger about the fact that Engstrand kept the truth about Regine from him for so long. Furious, he tells Engstrand that their friendship is over, but Engstrand manages to convince Manders that what he did wasn’t wrong, framing himself as a beneficent man who only wanted to help an unlucky woman. Suddenly feeling bad for saying such harsh things about Engstrand, Father Manders apologizes and agrees to bless the orphanage, and the two set off to organize the ceremony.
When Engstrand and Manders go to bless the orphanage, Mrs. Alving spends time with Oswald, who admits that he finds it incredibly difficult to be happy when he’s home. Part of this, he says, has to do with the fact that the sun never shines in this part of the world, which makes him feel incapable of painting. But this isn’t the only thing bothering him, he says. In fact, he tells his mother that he is quite ill, explaining that he finally went to a doctor in Paris who told him that he has been “worm-eaten since birth.” This, the doctor said, was something he inherited from his father, implying that Oswald has syphilis. Worse, Oswald has already had an episode during which the illness completely overtook him. The next time this happens, Oswald tells his mother, he will likely lose complete control of his body and mind and go catatonic for the rest of his life. He also tells Mrs. Alving that he blames himself for this miserable condition, even though he has more or less avoided living a reckless life. Mrs. Alving is beside herself, though she promises to take care of him here at home. Hearing this, Oswald asks her if she would do anything for him, and she says that she would. As they continue this conversation, they ask Regine to bring them champagne, since Mrs. Alving is trying to help Oswald feel happy despite his illness. Deciding to tell both Oswald and Regine that they’re half-siblings, Mrs. Alving instructs Regine to get herself a glass, too, but Pastor Manders enters before she can say anything more.
Manders says that he has blessed the orphanage, but changes the subject when he sees Regine with a drink in her hand. Mrs. Alving then informs him that she’s about to tell Regine and Oswald the truth about Captain Alving, but Manders tries to stop her because he thinks Oswald should maintain a positive image of his father. Just then, Regine looks out the window and sees that the orphanage is engulfed in flames.
After the orphanage has burned to the ground, Engstrand insists that Pastor Manders is the one responsible for the fire, claiming that he saw the pastor toss a snuffed candle into a pile of wood shavings. Going on at length about how bad this will look for the pastor, Engstrand works Manders into a fit of anxiety, at which point he offers to take the blame for the fire as long as Manders funds his hotel with the money he’ll get from selling the orphanage’s plot of land. Manders agrees to this deal and leaves with Engstrand. Once they’re gone, Regine learns about Oswald’s illness, at which point Mrs. Alving tells them that Captain Alving was Regine’s true father. Upon hearing this, Regine immediately leaves, saying that she won’t waste her time taking care of her half-brother when she could be working in Engstrand’s hotel, which Engstrand has decided to call the Captain Alving Home.
When Regine is gone, Oswald tells his mother that she will need to euthanize him whenever his sickness overcomes him. Taking out a small box, he shows her the 12 morphine pills he has saved for this very purpose, and though Mrs. Alving initially refuses, she eventually tells him that she’ll give him the pills if he it becomes necessary, though she insists that this won’t ever actually happen. Shortly after this exchange, though, Oswald stares at the rising sun and says, “Mother, give me the sun.” He then goes limp, and Mrs. Alving screams. Fumbling for the pills, she holds them in her hand and stares at her paralyzed son, unable to decide whether or not to kill him.