The town of Swallow Falls, located on a small island located under the “A” in Atlantic Ocean on the world map, suffers an economic downturn after the sardine market collapses. Flint Lockwood (Bill Hader) is a young scientist whose inventions, beginning as a child when he created unremovable Spray-On Shoes, have all ended in disaster. Flint's latest invention, the FLSDMDFR. It doesn’t work due to the lack of enough power at his home, so he is forced by his unsupportive and technophobic father Tim Lockwood (James Caan) to work at his Bait 'n’ Tackle shop. Flint immediately sneaks out while his father is at the unveiling of Sardine Land, a new tourist attraction. Flint, along with his pet monkey Steve (Neil Patrick Harris), hooks up the FLSDMDFR to the town's power station. Unfortunately, the FLSDMDFR absorbs so much power that it takes off like a rocket, destroys Sardine Land, and travels up into the stratosphere. Flint escapes an angry mob, and hides under the docks. Then he meets Sam Sparks (Anna Faris), a cute weather intern whose big break was ruined by Flint’s “rocket”. When the two witness giant purple clouds raining cheeseburgers over Swallow Falls, Sam reports the events and mentions Flint is responsible. Flint becomes famous, with new foods raining down every day. Mayor Shelbourne (Bruce Campbell) convinces Flint to create food every day that will turn Swallow Falls into a new tourist attraction. Flint also invents a machine to put uneaten food into a new "Mt. Leftovers".
After a date with Sam in a massive Jell-O mold, Flint invites his father Tim to dinner in order impress his father with his new success. Tim instead questions the wisdom of an endless supply of food, which angers Flint. After storming off, Flint realizes that the food is becoming larger, and heads to his lab to investigate. The mayor (now morbidly obese) shows up, and convinces Flint that keeping the FLSDMDFR running is the only way to get people to like him.
The next day while tourists from around the world are arriving, a spaghetti twister nearly destroys the town. Flint returns to his lab to turn off the FLSDMDFR, but finds the Mayor ordering a Vegas-style “All You Can Eat” buffet from the machine. Flint tries to send a kill code to the FLSDMDFR, but the Mayor accidentally destroys the communication device before the kill code can be sent. With the FLSDMDFR running wild, a storm begins to cover the world, destroying famous landmarks with giant food. Flint uploads the kill code to a flash drive and, along with Steve, Sam, “Baby” Brent (Andy Samberg), and Sam’s cameraman Manny (Benjamin Bratt), flies up into the stratosphere to destroy the overworked machine, while the citizens and remaining tourists build sandwich boats to escape into the ocean.
Nearing the location of the FLSDMDFR, Flint and the others find it is inside in a giant meatball where water clouds enter from the top and a food hurricane exits from the bottom. They are attacked by mutant foods with artificial intelligence, causing Flint to lose the flash drive. Flint, Sam, and Brent enter the meatball and make their way towards the FLSDMDFR. Flint calls his father and asks him to send the kill code from his lab computer to his cell phone. As Tim struggles to send Flint the kill code, the dam holding back Mt. Leftovers bursts and food covers the town, including the lab. Tim manages to survive the avalanche and sends the kill code. Flint is left to go on alone after Sam, who is allergic to peanuts, is cut by a shard of peanut brittle.
At the center of the meatball, Flint manages to upload the kill code into the FLSDMDFR, only to discover that his father had accidentally sent a video of kittens singing "Fight the Power" instead. As the FLSDMDFR prepares to expel a final blast of giant food, Flint uses his Spray-On Shoes formula to block the food expulsion hole, causing the meatball to explode. The giant food clouds around the world disappear, and Sam, Brent, Steve, and Manny manage to land safely. They at first assume Flint was killed in the explosion, but are relieved to find he has been saved by a flock of rat-birds (another of his failed experiments). Tim is finally able to express his love and admiration for son by using Flint's monkey-thought translator, and Sam and Flint share their first kiss. During the credits sequence, Flint and Tim are shown opening a business that uses the Spray-On Shoes formula to fix rooftops.