Trey Anastasio doesn’t look like a rock star. With his thick rimless glasses and flop of sandy red hair, you might say he resembles John Sebastian, but really, he looks like a mashup of Mike White and Jon Cryer and the filmmaker Chris Smith. He’s an appealingly ordinary shaggy-geek dude, like some guy you might share an office with in Portland.

Yet Trey Anastasio has sustained his career as (yes) a rock star in ways that defy all expectation. The band he leads, Phish, came together in 1983, and that takes them back to the formative moment of indie rock — R.E.M., U2, and so on. Phish, of course, picked up the long-jam, psychedelic-minstrel mantle of the Grateful Dead, and it’s worth noting that Jerry Garcia didn’t look like a rock star either — he was the grinning, pie-faced hippie Muppet of rock ‘n’ roll. But that was part of his mystique (it made the Dead seem an extension of their cult of fans), and Anastasio, too, has the blissed-out aura of a fan-turned-star. “Between Me and My Mind,” a portrait of Trey Anastasio directed by Steven Cantor, is a small but highly compelling rock doc, because it’s a look at the relatively rare rock ‘n’ roll star who’s a square, centered, and casually joyful human being.

Which isn’t to say that Anastasio lacks an oversize ego, or that he hasn’t experienced the inflated drama of the messianic rock lifestyle. In the mid-2000s, after Phish had called it quits, he was arrested for possession of illegally obtained prescription drugs — a fork-in-the-road cataclysm that he used as a chance to set his life right. In the movie, he’s up front about it, without going into the dirty details of his addiction; the point is that he got off controlled substances, and that the band came back together.

That highly publicized druggie descent may seem like the one place where Anastasio fell prey to the classic image of rock excess. But one of the luscious ironies of “Between Me and My Mind” is that it captures Anastasio as a kind of Middle American granola rocker, with a work ethic worthy of the most backbreaking carpenter (he’s always got about three projects going at once), yet he turns that very devotion into an obsessive form of rock ‘n’ roll. At one point he recalls how Robbie Robertson, in “The Last Waltz,” talked about being on the road for 15 years, and said that he’d had enough. Anastasio, by contrast, insists that he’ll never get enough. He wants to be on the road forever.

At 54, he leads a charmed life, and seems to know it. For years, he lived in an idyllic slice of Vermont, where he and his wife of 25 years, Sue Statesir (they still hold hands), raised two lovely daughters who are now in their twenties. Anastasio’s parents split up when he was 16, but he adores the prickly independence of his mother, and considers his father to be the ultimate role model. When he’s not on tour, he spends his days composing and recording in the Barn, his bucolic studio — it’s like a cross between a farmhouse and a church — nestled in Vermont’s Green Mountains. “I love it so much,” he says. “I love the process, I love writing music, I love being in the Barn. Like, you know, who gets to do this?” The movie was shot during the recording sessions for “Ghosts of the Forest,” the solo album Anastasio recorded in homage to his childhood friend Chris Cottrell, who was diagnosed with Stage IV adrenal cancer. Anastasio met Cottrell when he was 18, shortly after moving to Burlington, and the recording sessions are like an elegy that turns the past into the eternal.

One of the secrets of Phish’s longevity is that they’re a much hookier band than the Dead. Trey Anastasio carries himself like someone who can’t play the guitar any better than Jerry Garcia could, but, in fact, he’s a brilliant guitarist — he noodles like Dave Matthews, but can rock out as if he were leading Metallica. Offstage, he’s like a folkie with a Jack Black–in–”School of Rock” side. Phish may play extended jams, but much of the time they sound like a looser version of the Doobie Brothers. Preparing for their annual New Year’s Eve concert at Madison Square Garden, Anastasio visits the home of Page McConnell, Phish’s keyboard player, and they rehearse a song called “Soul Planet,” which in theme, at least, is totally Deadhead idyllic (”Everyone’s together on the…soul planet!/One beatin’ heart on the…soul planet!”), but it’s got a groove that won’t quit. At the MSG show, the song leads into the band’s token midnight spectacle: a giant pirate ship that sails out into the audience. Not a bad way to end the night for rock’s most wholesomely enduring and unlikely buccaneer.