They called him the “Singing Rabbi,” the dynamic performer who transformed Jewish life with ecstatic chasidic melodies. Rabbi Shlomo Carlebach married Jewish teachings with a universal message of peace and love. Now “Soul Doctor,” a new musical based on the man and his music, is coming to Broadway. Yet swirling around the show, which opens next week at the Circle in the Square, are the allegations of sexual harassment that surfaced after his death in 1994.

Born in 1925 in Berlin, Carlebach was the scion of rabbinical dynasties in Germany. He spent his youth in Austria and Switzerland before moving to Lithuania, and then finally to New York, when his father became the rabbi of Congregation Kehilath Jacob on the Upper West Side, now known as the Carlebach Shul.

Educated at fervently Orthodox yeshivas in the 1950s, Rabbi Carlebach turned to songwriting to reach out to college students and others who were disaffected by traditional Judaism. Following an appearance at the Berkeley Folk Festival in 1966, he stayed in the Bay Area, where he founded the House of Love and Prayer to heal young drug addicts and runaways. Upon his father’s death in 1967, Rabbi Carlebach returned to New York to take over his father’s shul and develop a platform for the melding of Yiddishkeit with hippie culture. Though he died nearly 20 years ago, his music is still sung in synagogue services around the world.

Directed by Danny Wise, “Soul Doctor” stars Eric Anderson as Carlebach. It follows the rabbi’s life from his early years in Europe to the peak of his fame in the 1960s, when he performed with Bob Dylan, Jefferson Airplane and the Grateful Dead. It shows Rabbi Carlebach befriending jazz musician Nina Simone (Amber Iman) and combining chasidic music with gospel and soul — despite facing censure from Orthodox authorities for his full inclusion of women in concerts and services.

The long journey that “Soul Doctor” has taken to get to Broadway is reminiscent of Rabbi Carlebach’s own peripatetic wanderings. First performed in 2007 in a workshop at the Folksbiene, it went through a series of staged readings at Jazz at Lincoln Center, the Museum of Jewish Heritage and the Roundabout. The first full production was done in 2012 in New Orleans, and then the musical toured Florida before resurfacing last year at the New York Theatre Workshop.

The current production, which contains more than 30 Carlebach songs (some with new lyrics by David Schechter), is choreographed by Benoit-Swan Pouffer, the former artistic director of Cedar Lake Contemporary Ballet, a forward-thinking company based in New York.

In an interview, Wise told The Jewish Week that Rabbi Carlebach was “in love with humanity, with the moment, and with life,” and that his “burning desire to heal” came from his childhood in the shadow of the Holocaust. Wise recalled an episode when Rabbi Carlebach, having just performed at the Metropolitan Opera, went down under the West Side Highway and gave a concert for a hundred homeless people. “He felt more honored there than at the Met,” Wise said.

Just as Simone was the voice of the civil rights movement in America, Wise added, Rabbi Carlebach was the “voice of the Jewish revival, who brought hearts and worlds together through his music.” At a recent General Assembly convention of the Jewish Federations of North America, Wise recalled, each denomination worshipped on Friday night in a separate hotel room, but Rabbi Carlebach’s melodies issued from every room.

Neshama Carlebach, the rabbi’s daughter, has released seven CDs that mix chasidic and gospel melodies. She views “Soul Doctor” as her father’s “first real introduction to the general population.” His music, she said, is “tied to the most meaningful moments of Jewish people’s lives — when babies are born, when people get married, and when people die. And now the whole world will discover the hypnotic, overwhelming open-ness that comes from this music.”

As Anderson, the non-Jewish actor who plays Rabbi Carlebach, put it, “It seems that everybody he touched was forever changed by him. He continuously built a family out of everyone he met.”

Rabbi Samuel Intrator was Rabbi Carlebach’s hand picked successor at the Carlebach Shul, although he left in 2000 over a dispute with the board. Now serving a congregation in Miami Beach, Rabbi Intrator continues to carry on Shlomo’s legacy with Carlebach services at synagogues and Hillels.

The musical’s achievement, Rabbi Intrator explained, is to “capture the universal message of Shlomo, of a man who crossed bridges and traveled tracks that no else did.” While Rabbi Carlebach based his teachings on the 18th- and 19th-century founders of chasidic Judaism — the Baal Shem Tov, Rebbe Nachman of Bratslav and the Ishbitzer Rebbe — he expanded their particularistic, mystical philosophy to preach love, redemption and peace to all humanity.

As a result, Rabbi Intrator recalled, “Shlomo hugged more Jews than anyone. He never led services in his shul; he stood near the door to greet people as they walked in. He was late to his own concerts because he was standing in the entryway hugging the audience.”

Rabbi Carlebach’s penchant for physical contact with his followers appears, however, to have exceeded the bounds of propriety. (The play appears to steer clear of this, and Wise did not return calls for comment on the controversy.) In 1998, four years after his death, Lilith Magazine published an exposé by Sarah Blustain headlined “A Paradoxical Legacy” that quoted numerous women who recounted stories of being fondled by Rabbi Carlebach during or after his appearances at their camps or teen groups. (“Oy,” he is quoted as saying to one who confronted him, “this needs such a fixing.”) In 2004, a bid to rename West 79th Street from Broadway to Riverside Drive after Rabbi Carlebach was voted down by the City Council because of the controversy.

Those who were close to Rabbi Carlebach defend him by saying that he was a product of the Free Love period of the 1960s, that he was a guru figure to whom many were powerfully attracted, and that he pulled down gender barriers in prayer, study and celebration.

Susan Weidman Schneider, the longtime editor of Lilith, isn’t buying these excuses. “Carlebach created a more inclusive Judaism,” she said, “but he did not respect other kinds of boundaries. It’s possible that the same characteristics that enabled him to open doors to those who felt disenfranchised from Judaism were the same ones that caused him to act in inappropriate ways.” She compared Rabbi Carlebach to mayoral candidate Anthony Weiner in his apparent lack of control over his impulses.

“He wasn’t an angel,” Rabbi Intrator conceded. “Nor did he want to be seen as one. He was very human. While the whole world taught you to try to live up to your potential, Shlomo taught that you should live beyond your potential.” The new musical, Rabbi Intrator exulted, shows the “joy and energy of what it means to be a Jew.”

“Soul Doctor,” which is now in previews, opens on Thursday, Aug. 15 at the Circle in the Square, 1633 Broadway (at 50th Street) Performances are Monday-Saturday at 8 p.m., with Wednesday and Saturday at 2 p.m. For tickets, $135, call Telecharge at (212) 239-6200 or visit www.telecharge.com.