The actors shred live onstage in the touring production of the “School of Rock” musical. (Evan Zimmerman)

Merritt David Janes graduated from the University of Maine in 2004 with a bachelor’s degree in music education. But becoming a teacher was never his intent.

“To be very honest, I wanted to be a performer,” Janes says. “If I was going to college, I wanted something that I could do and use along the way and draw from and, perhaps later in life, have to go back to. And teaching seemed like a really great thing.”

Today, the 37-year-old finds himself strumming along to both beats while playing the lead role of Dewey Finn — a garage band slacker turned impromptu music teacher — in the touring production of “School of Rock.”

“I didn’t realize I was going to be the best music teacher at the best music school in the world,” Janes says. “But here I am.”

The musical, which begins a run at the National Theatre on Wednesday, opened on Broadway in 2015 as an adaptation of the Jack Black film. Featuring music from the 2003 movie in addition to new songs written by Andrew Lloyd Webber, “School of Rock” follows Dewey as he stumbles his way into a job as a substitute teacher at a hoity-toity prep school and comes to unearth his students’ dormant musical talents.

As the story builds toward the class’s participation in a Battle of the Bands contest, Janes and the preteen actors rock out live onstage while performing with real instruments.

“I can’t think of many other shows that have put as many musical instruments into kids’ hands as our show,” Janes says. “I think everyone should be a songwriter, everyone should play an instrument, and the world would be a better place if everyone did.”

Merritt David Janes’ wannabe rock star Dewey Finn teaches prep school preteens how to let loose. (Evan Zimmerman)

Janes’ musical roots run deep. His mother is a longtime co-concertmaster of the Vermont Philharmonic, his father has “a hell of a country singing voice” and his grandfather was a gifted pianist. Himself a trumpet, guitar and piano player, Janes rode his talents to Europe for a series of concert tours during his college days, then relocated to New York City and studied at the Circle in the Square Theatre School from 2005 to 2007.

From there, the Vermont native landed roles in touring productions including “Sweeney Todd,” “Beauty and the Beast,” “Shrek” and “Phantom of the Opera.” When Laurence Connor, the director of “Phantom’s” 25th anniversary tour, took the helm of “School of Rock” on Broadway, he brought on Janes as a member of the original ensemble and understudy for the role of Dewey.

After nearly two years on Broadway, Janes joined “School of Rock’s” touring production in 2017 as the official Dewey alternate before moving up to top billing this past fall. Every time Janes steps onstage, he’s asked to meet the considerable vocal, physical and emotional requirements that come with capturing the character’s high-octane persona and carrying the bulk of the musical numbers.

“It’s a very, very demanding role — some might say the hardest role out there,” Janes says. “It’s like running the vocal Olympics.”

Since moving into his current New York City apartment nearly 14 years ago, Janes has spent nine years on the road, he estimates. In pursuing his passion, he’s put off a family life. “Sometimes it gets a little lonely out here,” he says. “I’m not married, I don’t have kids — it’s because I dedicated my life to my great affection.”

It’s a life Janes envisioned during his high school days, when he was a budding performer not unlike the students in “School of Rock.” He vividly remembers telling a guidance counselor back then of his aspirations for a life of acting, singing, playing instruments, traveling and teaching.

This counselor, it’s safe to say, was no Dewey Finn. “ ‘That’s very nice, but that’s not going to happen,’ ” Janes recalls hearing. “ ‘Choose one thing — don’t spread yourself so thin.’

“Every single one of those things on my list came true,” Janes says. “And I don’t take for granted one second the fact that I’m on a glorious, fantastic adventure.”

National Theatre, 1321 Pennsylvania Ave. NW; Wed. through Jan. 27, $54-$114.