Sofer was born in Baghdad, Ottoman Iraq. He studied the Torah under Abdallah Somekh and the Ben Ish Hai. In 1904, he journeyed to Ottoman Palestine together with colleagues Sadqa Hussein and the Asei HaYa'ar in order to meet with the Rishon LeZion, known as the Yisa Berakha, and to pray at the graves of the righteous. After visiting Jerusalem, he decided to settle there permanently. He studied in the Bet El yeshiva in the Old City of Jerusalem, well known for the study of kabbalah. In 1909 he moved to the newly founded Shoshanim leDavid yeshiva. It was here that he composed his works.
In Kaf Hachaim ( ), Sofer discusses the halakha in light of the Rishonim and Acharonim. Kaf Hachaim, usually published in ten volumes, covers Orach Chayim (8 vol.) and parts of Yoreh De'ah (2 vol.). It is often compared to the Mishnah Berurah in terms of scope and approach, but differs in its more extensive reliance upon quotations. This work also surveys the views of many kabbalistic sages (particularly Isaac Luria), when these impact the Halakha. Shinun Halacha is a work summarising the Halakhic conclusions presented in Kaf Hachaim.
In addition to the Kaf Hachaim, Sofer authored: