When Trey Anastasio agreed to let a film crew follow him around, there were no restrictions. His New York apartment, his tour bus, his intimate moments with his dying best friend — all of it was fair game.

“He never said, ‘Turn off the cameras,’” said Steven Cantor, who directed “Between Me and My Mind.”

Following its premiere at the Beacon Theater during the Tribeca Film Festival in April, movie theaters nationwide showed the documentary on Wednesday, July 17, then added Monday, Aug. 5, showings due to popular demand, with additional theaters.

The film focuses on the guitarist and vocalist’s creative process as he drives the popular band Phish and his solo career.

Producer Jamie Schutz — a tried and true Phishhead — stressed in a pitch meeting with band manager Patrick Jordan, “I wanted to create a film that Phish fans would get behind and make sure that it gave them an insight into this band, and it had to feel authentic.”

The next day, Jordan let the filmmaker know that Anastasio, who was about to start work on his most personal work yet, the solo album “Ghosts of the Forest,” was in. What results is an intimate portrait of Anastasio recording the solo record with Phish drummer Jon Fishman and Anastasio’s bassist Tony Markellis — The Post is premiering an exclusive clip from those sessions — a storyline that runs concurrently with Phish prepping for a massive run of 13, no-songs-repeated shows at Madison Square Garden (The Baker’s Dozen) in 2017 and the three-set New Year’s show, also at MSG.

Fans get an unprecedented look into Anastasio’s relationships with his Phish bandmates and his family. In one-on-one sit-downs with each parent, his wife and two daughters he reexamines his roles as a son, husband and father. We’re treated to some sweet moments, like when his mother, sitting with the musician on a park bench dedicated to his sister, Kristy, who died of cancer, recalls the rambunctious future rock star drumming on her car headrest. Anastasio also asks his wife if she considered leaving him when he struggled with hard drugs.

“He has a very close relationship with his family members,” Cantor says. “I think he’s lived his life in the present, and maybe the past was cheated a little. I think being in his reflective state of mind with Chris made him want to take stock of things and maybe look at the impact on his family.”

Chris “C-Cot” Cottrell, Anastasio’s friend since their teen years in New Jersey, died from adrenal cancer in January of 2018.

The documentarians said that if their subject wasn’t so open, they wouldn’t have bothered making the film.

“There’s that old adage, which is ‘never meet your heroes because you’ll be disappointed,’” Schutz says. “It’s happened to me in the past. It was completely the opposite in this case, because Trey is one of the warmest, most genuine, incredible guys I’ve ever met. You feel that when you’re in his presence. And Steven and I were in his presence quite a bit over the course of two or three years.”

Cantor jokes: “That’s why he took 340 selfies with Trey.”