Dewey Finn. a hard rock singer and guitarist, is unanimously kicked out from his band No Vacancy by the rest of his bandmates for his arrogance and frequent hyperactive stage antics. His submissive roommate and lifelong friend Ned Schneebly, a substitute teacher, threatens Dewey with eviction under heavy pressure from his girlfriend Patty Di Marco unless Dewey "gets a real job" and pays off his growing rent debt. Dewey feels forced to give up his passion until he receives a phone call intended for Ned from Rosaline Mullins, principal of Horace Green, a prestigious prep school, asking Ned to fill in for a teacher who would be out for several weeks. Desperate for income to avoid getting evicted, Dewey impersonates Ned and takes the job as a substitute teacher for the fifth-grade class.
Dewey has no real idea how to carry out his role as a teacher, and instead simply gives his students constant free time. However, when he overhears his pupils playing in music class he realizes that some of the children in the class have musical talent. He decides to turn his temporary job into what he tells them is a special class project, but is actually a personal one: to turn a classroom full of kids into a rock band and crew which will serve as a vehicle to stardom, ultimately to win the upcoming Battle of the Bands, where he is out to avenge his eviction from his old band and win the $20,000 prize.