Ralph Metzner, a German-born and Harvard-trained psychologist who veered into the world of altered consciousness and psychedelics on his way to a longtime position as professor and academic dean at the California Institute of Integral Studies in San Francisco, has died. He was 82.

Metzner wrote more than 20 books, most prominently “The Psychedelic Experience,” which he co-wrote with Timothy Leary and Richard Alpert to start a revolution when it was published in 1964, three years before the Summer of Love. His most recent book was “Searching for the Philosophers’ Stone: Encounters with Mystics, Scientists and Healers” published two months before Metzner died of idiopathic pulmonary fibrosis, a degenerative lung disease for which there is no cure.

He died March 14 at his home in Sonoma.

Metzner had as deep an interest in the topic of death and dying as he did in psychoactive substances, and he used his own terminal illness as an example of how to do it right. After Metzner entered hospice care, two weeks before his death, he held regular meetings with his editor regarding three of his books in the pipeline.

He finished sorting out his library of books into 44 boxes to be shipped to Purdue University, where it will be named the Ralph Metzner Library.

The night before he died, and just as he was going to sleep, he told his wife, Cathy Coleman, “I feel like I am going to die tonight. I want to die. I am ready to die.” But he did not die that night. The next night, after she told him that his library had been packed and shipped, and that project complete, he then laid down to sleep, with Coleman at his side, and did not stir again.

“Ralph was all about awareness and personal growth right up until the end,” Coleman said. “In his last days he was especially open-hearted and tender, and expressed gratitude for everything, for each small favor.”

Metzner was born in Berlin on May 18, 1936. His father was a publisher, and his mother an emigrant from Scotland. During World War II, the family fled to the German countryside. His mother later took her three sons to Scotland while Berlin was being rebuilt.

Metzner attended Queen’s College at Oxford University before advancing to graduate school at Harvard University in 1958. In the psychology program, he became the research assistant to Leary and Alpert (Ram Dass), which involved personal research on LSD and psilocybin. Among their clinical experiments was the Concord State Prison Project in which they took psilocybin with inmates.

“It was all about awareness for what they had done, and healing trauma,” Coleman said.

Metzner became editor of the Psychedelic Review scholarly journal, and after publication of “The Psychedelic Experience,” he had a national reputation. It followed him to California, where he became part of a meditative community called the School of Actualism near San Diego.

In 1975, Metzner was hired as a professor at what was then called the California Institute of Asian Studies in San Francisco. It had no full-time faculty and fewer than 100 students in a campus that was always on the move. A few years later he was named Dean.

Metzner wrote the accreditation document and oversaw a name change to the California Institute of Integral Studies, and a move from the Mission to a vacant Catholic school on Ashbury Street just off Haight. By the time he stepped down as dean, in 1989, the student body had grown to 500 students. (The school now has 1,500 graduate students, 75 full-time faculty and a building that it owns on Mission Street.)

“Ralph was a pioneer in psychedelic research, and was a highly accomplished and productive scholar in all fields of psychology,” said Robert McDermott, president emeritus of the California Institute of Integral Studies. “Not every faculty member is known outside the school, but Ralph was. He had a wide reputation and was distinguished and admired.”

In 1988, just before he stepped down as dean, Metzner married Coleman, who had taken seven classes from him, and was by then dean of students. Their wedding ceremony was in the American Indian tradition atop Mount Tamalpais one hot July day in 1988, with 200 guests as witness.

Metzner and Coleman were both interested in astrology and ecology, and continued to actively research psychedelics. They soon formed the Green Earth Foundation, an education and publishing nonprofit that released “Allies for Awakening,” a manifesto of psychoactive substances, published in 2015.

Metzner had long since retired from academia, but he never retired from researching and writing about drugs, and spreading the word through his lectures.

“Ralph was a true investigator at heart,” said Dr. Charles Grob, professor of psychiatry at the UCLA School of Medicine. “In the field of psychedelic research studies, he was involved at the very beginning, and he worked at it up until the end. Much of what I learned from him I have been able to apply in my own research, and the same with my colleagues. He was a skilled and dedicated teacher, and highly respected in our field.”

Among the hallucinogens he explored were ayahuasca, psilocybin, LSD, 5-MeO-DMT, San Pedro, MDMA and MDA. He was open to peyote, though nobody brought any to his wedding.

“Native Americans regard the peyote ceremony as religious, medicinal and psychotherapeutic,” he once told Chronicle religion writer Don Lattin. “It’s an integrated, holistic approach, and a genuine religious experience.”

But his drug use was never recreational.

“Ralph took his work very seriously, and yet he could be funny, with a dry wit,” Coleman said. “He was always working on some new process at his desk.”

One of these was a personal growth process he branded Alchemical Divination. He developed a curriculum and taught it at retreats in Petaluma, New Mexico and Switzerland. It was a weeklong commitment, and those who persevered would earn a certificate of completion. He also maintained a private psychotherapy practice with an office in San Rafael.

In his 60s, Metzner decided he did not have enough to occupy his mind and took up jazz piano. He’d had exposure as a child in Berlin and took to it quickly. He ended up recording an album of original material, “Bardo Blues and Other Songs of Liberation,” on the Green Earth Foundation label.

“He never stopped,” Coleman said. “He had an insatiable curiosity about the mysteries of life. Nothing was too strange for Ralph.”

Two days before he died, a copy of Simcha Paull Raphael’s “Jewish Views of the Afterlife” arrived with Metzner’s endorsement on the back cover. It seemed to be a sign he was headed for the afterlife, said Coleman.

Metzner was predeceased by a son, Ari Metzner, killed in a childhood bicycle accident. Survivors include his wife and daughter, Sophia Metzner, both of Sonoma, and stepson, Elias Jacobson, of Boston.

Plans for a public memorial are pending.

Memorial contributions can be made to the American Civil Liberties Union, Union of Concerned Scientists, National Park Foundation and California Institute of Integral Studies-Center for Psychedelic Therapy and Research. Designated checks can be sent to: Cathy Coleman, P.O. Box 1202, Glen Ellen, CA 95443-9321.