Cole Carter (Zac Efron), a former track star, college dropout, and struggling 23-year-old DJ in the electronic dance music (EDM) scene, dreams of becoming a major record producer. Cole books a gig to DJ at a local nightclub, where he meets the headliner, a once-innovative DJ, James Reed (Wes Bentley). James invites Cole to a party, where Cole hallucinates because a joint they shared contained Phencyclidine (PCP). The morning after, Cole wakes up at James' house, where he is introduced to Sophie (Emily Ratajkowski), James' girlfriend and personal assistant, who drives him home.
Later, James calls Cole to DJ at his house party, a paid gig. Cole's friends Dustin Mason (Jonny Weston), Ollie (Shiloh Fernandez), and Squirrel (Alex Shaffer) show up, and after a party goer insults Mason, Mason gets in a fight with him and has to be pulled out of James's pool. Despite his background and friends, James sees potential in Cole and takes him as his student. After listening to Cole's original song, James criticizes Cole for imitating other well-known producers, and he suggests using organic sounds for an original vibe. They write a song using the original vibe technique and vocals from Sophie, which is well received at a local nightclub. Next, Cole and his friends head to Las Vegas for a music festival, where he meets up with Sophie, whom James ditched. Sophie gives Cole MDMA, and they sleep together, spending the night at a hotel.
Back in San Fernando, James invites Cole over to watch an MMA fight with him and Sophie. An awkward moment ends up with Sophie telling Cole to accept what happened and leave it alone, and James gives Cole a new MacBook Pro and the opportunity to open for him at a popular music festival. One day, Cole and Paige (Jon Bernthal) meet up with Tanya Romero (Alicia Coppola), whose house is being foreclosed. During the negotiation, Paige buys her house and rents it back to her, intending to sell it quickly for a substantial price, which angers Cole. While James' alcoholism begins to affect Sophie, he and Cole go to a strip club for his birthday. Cole gets sick, and James finds out about Cole's relationship with Sophie, and severs ties with him. Returning to his three friends, it is revealed that Squirrel has been looking for better jobs, and Mason has rented a house for all of them. Following intense partying, Squirrel is found unconscious and dies from an overdose. After the funeral, the remaining friends begin to question their future, and go their separate ways after Mason blames Ollie for the drugs that killed Squirrel. Cole visits James, whose alcoholism has completely consumed him, to let him know of Squirrel's death and that it could possibly have been his fault. James consoles him and also tells him that Sophie moved to the San Fernando Valley and works at a local coffee shop, where he later visits her.
While taking a run, the battery of Cole's phone goes dead, causing his music to stop playing. Upon closer observation, he listens to his surroundings, which inspires him to record samples and integrate them into his long-awaited track. Cole then calls and tells James that he has something for Summer Fest, and James gives him another chance. The festival is set outside the American Apparel building in Los Angeles. Cole releases his track, which contains snippets of his conversations with Sophie and Squirrel, and he later uses Squirrel's quote "Are We Ever Going To Be Better Than This?" as a hook before the beat drop. When the song ends, Cole is met with enthusiastic acclaim from the audience and James. The film concludes with Sophie going back to college, Ollie reading for an audition, Mason handling the nightclub, and Cole remaining positive about his future and creating a proper relationship with Sophie.
In the mid-credits scene, Tanya opens her front door to an Adidas box that Cole has been saving all of his earnings in throughout the film.
Zac Efron as Cole Carter
Emily Ratajkowski as Sophie
Shiloh Fernandez as Ollie
Alex Shaffer as Squirrel
Jonny Weston as Dustin Mason
Wes Bentley as James Reed
Joey Rudman as Joey
Jon Bernthal as Paige Morrell
Vanessa Lengies as Mel
Brittany Furlan as Sara
Jon Abrahams as a club promoter
Alicia Coppola as Tanya Romero
Korrina Rico as Crystal
Nicky Romero as himself (Cameo)
Dillon Francis as himself
Alesso as himself
DallasK as himself
Them Jeans as himself
Zach Firtel as DJ Sweet Baby Ray's
Andy Ward as DJ Xochil
Hayden Fein as DJ DK
Jacob Epstein as DJ Bald Dad
King Bach as himself (Cameo)