An unspecified global catastrophe looms, an underground city known as Ember is constructed to shelter a large group of survivors. In addition, a small metal box intended for a future generation of Emberites is timed to open after 200 years. This box is entrusted to the Mayor of the City of Ember, and each Mayor passes it on to his or her successor. When the seventh Mayor dies suddenly, the succession is broken, and over time, the significance of the box is forgotten. The box opens by itself at the allotted time, but this goes unnoticed. Several decades later, Ember's generator begins to fail, and food, medicine and other necessities are in dangerously short supply.
At a rite of passage for all graduating students of Ember City School, Mayor Cole stands before the students as their adult occupations are assigned by lottery. Doon Harrow, the son of inventor and repairman Loris Harrow, is assigned "Messenger" while his classmate Lina Mayfleet is assigned "Pipeworks" and apprenticed to the elderly technician Sul. Shortly afterward, the two secretly exchange assignments. At home, Lina (a descendant of the seventh Mayor) finds the opened box and enlists Doon's help to decipher its contents. Gradually, they learn that it contains a set of instructions and directions for an exit from the city.
Later, after evading a gigantic star-nosed mole, they also discover that Mayor Cole has been hoarding canned food in a secret vault for his own benefit while the people go hungry. When Lina attempts to report this, the Mayor captures her and tries to steal the box, but she escapes during a blackout. Now fugitives from the Mayor's police, Lina and Doon, accompanied by Lina's little sister Poppy, use the instructions and assistance from Sul to flee the city via a subterranean river. When the repercussions of their actions trigger a panic in Ember City, the Mayor locks himself in his vault, only to be devoured by the giant mole.
Doon, Lina and Poppy eventually reach the Earth's surface where they, for the first time in their lives, witness a sunrise. They also locate Ember in a hole in the ground, too far for them call to anyone. So before they explore, they drop a letter with information on how to get out, tied to a rock, into Ember, where it is found by Loris.
Saoirse Ronan as Lina Mayfleet
Harry Treadaway as Doon Harrow
Bill Murray as Mayor Cole
Tim Robbins as Loris "Barrow" Harrow
Martin Landau as Sul
Toby Jones as Barton Snode
Marianne Jean-Baptiste as Clary Lane
Liz Smith as Granny Mayfleet
Amy Quinn and Catherine Quinn as Poppy Mayfleet
Mary Kay Place as Mrs. Murdo
Mackenzie Crook as Looper
Lucinda Dryzek as Lizzie Bisco
Matt Jessup as Joss
Simon Kunz as Captain Fleury
Ian McElhinney as Builder
based on the 2003 novel The City of Ember by Jeanne DuPrau