In Coolsville, Ohio, a pet adoption fair is held. A talking Great Dane named Scooby-Doo is up for adoption, but nobody is interested in him. Later, on the way back to the pound, Scooby is accidentally left behind when the crate he is in falls off a truck. Seeking shelter from a rainstorm, he comes across a graveyard where he witnesses two ghosts rise from their graves. Scooby panics and runs away, ending up in the bedroom of Norville "Shaggy" Rogers, a clumsy and geeky outcast. The two quickly bond and Shaggy decides to adopt Scooby.
Later, Shaggy tries to smuggle Scooby onto the school bus, but a fight between Shaggy, Scooby, and a bully breaks out which causes the bus to crash into a flagpole, which falls on Vice Principal Grimes' car, damaging its windshield. Because of the fight on the bus and the damage to Grimes' car, Shaggy is sent to the library for detention (while Scooby is tethered outside), along with three others: Fred Jones, the quarterback of the football team; Velma Dinkley, a science nerd; and Daphne Blake, a wealthy drama club student. They bond somewhat over a shared interest in mysteries, but quickly get on each other's nerves. The ghosts suddenly appear and chase them to the gym where a pep rally is taking place. A masked figure in a cloak known as the Specter appears, demanding everyone to leave. The stamp-collecting Principal Deedle decides to close the school, but Grimes deems it a prank and suspends the quartet as he refuses to believe that there are ghosts in the school.
The gang try to clear their names by investigating the ghosts at it, but Shaggy and Scooby end up being locked in the cafeteria freezers. They are freed the next morning by Grimes, who expels them from the school, and threatens to have them arrested for trespassing if they set foot on school property again. Assuming the school librarian and janitor might be trying to close the school after Shaggy remembered overhearing them complaining about it, they use Daphne's knowledge of theatrical costuming to sneak into the school, but they are exonerated when Velma discovers a spell book was recently checked out by Grimes, making them think Grimes is their prime suspect. Searching at night at Grimes' house, they learn that the school grounds were once used by Coolsville Academy, a prep school that was destroyed during a flood the same day they intended to bury a time capsule of the school's history; the gang concludes the ghosts are trying to get their school shut down so they can search for the time capsule unimpeded. The ghosts attack again, and the teens are knocked out. The Specter, keeping Scooby and Grimes as prisoners, forces the gang to search underground for the time capsule. Unable to find the capsule, they trick the Specter into coming down to carry the capsule out of the hole, but the plan backfires when they try to lock him up in a flooded room, and the Specter acquires the capsule.