He was born in 400 A.H. in Ghazni (Afghanistan). He belonged to a Syed family (descendant of the Holy Prophet). He completed his earlier education in Ghazni by memorizing the Holy Quran. Then he studied Arabic, Farsi, Hadith, Fiqh, Philosophy etc. At that time Ghazni was the center of education in Central Asia, and it was the realm of the famous Afghan ruler Sultan Mahmood Ghaznavi.
After completing the wordly education, he searched for the spiritual education. He travelled to many places for this purpose, and finally became spiritual disciple of Hazrat Abul Fazal Mohammad bin Khatli, in Junaidiya Sufi Order, who lived in Syria.
In Syria, Hazrat Ali Hajveri started his spiritual education under the guidance of Hazrat Abul Fazal, he slept less, ate less, performed tough contemplations & meditation. Then he travelled to many countries & places like Iran, Iraq, Syria, Turkey, Arabia, Azerbaijan etc. There he met many Sufi saints & dervishes.
Once he entangled in a spiritual mystery, and wasn't able to solve it, so then he went to the tomb of Hazrat Bayazid Bistami, where he meditated for many days, even he finally solved that spiritual mystery. On another occasion he entangled, and also went to the tomb of Hazrat Bayazid Bistami, but this time he found no clue. So then he left for Khurasan (A Province in Iran), he stayed in a village, where he found a group of Sufi dervishes. Because Hazrat Ali Hajveri always wore simple & normal dress, so those Sufis said to eachother that this person (Ali Hajveri) doesn't belong their group, (As they all were wearing specific dress of dervishes). Hazrat Ali Hajveri stayed with them, they ate delicious foods, and gave him a dry bread to eat. They also mocked on Hazrat Ali Hajveri, threw on him the crusts of fruits. Hazrat Ali Hazjveri addressed God: "O God! if these people wouldn't be wearing the clothes of your friends (dervishes), then I wouldn't tolerate their insulting behavior."
During the journey of Syria, he visited the tomb of the great Companion of the Holy Prophet, Hazrat Bilal. There he slept for a while, and found himself in Makka, where he saw the Holy Prophet with an old man, he didn't recognize him & thought who he could be? Then Hazrat Ali Hajveri fell on the feet of the Holy Prophet & kissed them. The Holy Prophet knew what Hazrat Ali Hajveri had in his mind, so he told Ali Hajveri: "This old man is Abu Hanifa, your Imam."
Later his spiritual teacher Hazrat Abul Fazal ordered him to go to Lahore to preach the spiritual teachings of Islam. He said: "Hazrat Shah Hussain Zanjani is already there for this purpose, so then why should I go to there? Hazrat Abul Fazal said: "It's none of your business, just go to Lahore." So he left Syria & came to Ghazni. From Ghazni he went to Peshawar & then to Lahore, in 1041 A.D (431 A.H). When he reached to Lahore, he saw that people are taking a coffin towards the graveyard for burial. He asked who is he? People replied that it is the dead body of Hazrat Shah Hussain Zanjani. After hearing that, he understood why his teacher Hazrat Abul Fazal sent him to Lahore. After reaching to Lahore, he started to preach Islam & built a mosque there.
At that time Lahore was included in the Ghazni Kingdom, whose ruler was Sultan Mahmood Ghaznavi. And the governer of Lahore was Ra'e Raju, who was a Hindu & had many great mystical abilities. People of Lahore were used to supply milk to Ra'e Raju in big quantity, as a capitation. Once an old woman was on her way to pass before Hazrat Ali Hajveri, holding a water-pot poured with milk. Hazrat Ali Hajveri asked her to give him some milk from that. The woman refused & said that she has to give it to Ra'e Raju. Hazrat Ali Hajveri said: "Give some milk to me, by the grace of God, your cow will produce much more milk than usual". The woman gave him the pot, Hazrat Ali Hajveri drank some milk, and then threw the remaining into the river. The old woman when went to her home, she was surprised to see the breasts of her cow who were full of milk. She poured all of her pots from milk, but still the cow's breasts were full. Soon this news spread all around the Lahore, and people started to visit Hazrat Ali Hajveri, and all people brought milk for him, and he also drank some milk from their pots & then threw the remaining into the river, and all of their cows started to produce more milk. So they stopped to supply milk to Ra'e Raju.
Later Ra'e Raju sent one of his disciples to Hazrat Ali Hajveri, as his disciples also had mystical abilities. That disciple didn't come back, so Ra'e Raju sent another disciple, who also didn't come back. In that way, he sent all of his disciples, but no one came back at all. Finally he himself went to Hazrat Ali Hajveri, in anger. Ra'e Raju challenged Hazrat Ali Hajveri to show him any miracle. Hazrat Ali Hajveri replied: "I'm not a juggler." But Ra'e Raju tried to impress him with his miracles, and started flying in the air, Hazrat Ali Hajveri ordered his shoes to bring him down. So the shoes of Hazrat Ali Hajveri went to the flying Ra'e Raju & started to strike on his head & broght him down. Ra'e Raju was inspired & embraced Islam on his hands. After accepting Islam he changed his name as Shaikh Ahmed Hindi.
When Hazrat Ali Hajveri built a mosque in Lahore, that mosque's front was towards south, and differed from all other mosques of Lahore. So there became a doubt that this mosque's fron't isn't towards Ka'ba. The Scholars of Lahore objected over that mosque, but Hazrat Ali Hajveri didn't reply them. When the mosque was built completely, he invited all scholars of Lahore & said to them: "You objected over this mosque's Ka'ba direction, now look by yourself in which direction Ka'ba actually is!" When they looked at the front, they saw Ka'ba, as they are sitting before Ka'ba in Makka. All scholars felt ashamed after watching that, and apologized.
Hazrat Ali Hajveri also built a room adjacent to that mosque, and used that room as Khanqa (Spiritual School). Many unbelievers accepted Islam on his hands, many people touched the higher stages of spirituality under his guidance. He married twice, but both of his wives died soon after marriage. He had a son, named "Hasan".
He lived in Lahore for 21 years, and then went to Syria to meet his spiritual teacher Hazrat Abul Fazal. And after the death of Hazrat Abul Fazal in 453 A.H, he again came to Lahore.
Hazrat Ali Hajveri wrote many books, some of his books are: Diwan-e-She'r; Minhajuddin; Al-Bayan Lahal- Al-Ayan; Israrul Kharq Wal-Mauniyat; Behrul Quloob; Kitab Fana Wa Baqa; Birri'ayat Be-Huqooq-Ullah; Kashful Israr; Sharah-e-Kalam; and Kashful Mahjub.
He died at the age of 65 in 465 A.H., in Lahore.
It has a been a practice of Sufi saints coming to the Indian subcontinent to first visit the shrine of Hazrat Usman Ali Hujwiri. Hazrat Khwaja Muinuddin Chishti first came to Lahore in 561 A.H (1165 AD), he stayed at the tomb of Hazrat Ali Hajveri for two weeks to pay his respects at Data Ganj-Bakhsh upon his arriving in the subcontinent. There he was directed to settle in Ajmer Sharif and commence his spiritual mission in India. Hazrat Moinuddin Chishti paid homage to Hazrat Usman Ali Hujwiri in the following words:
Ganj Bakhsh-e faiz-e aalam, mazhar-e Nur-i Khuda
Naqisaan ra pir-e kaamil, kaamilaan ra rahnuma
Ganj Buskh (Bestower of Spiritual Treasures) is a grace to the world; a manifester of God's light.
A perfect spiritual teacher for the beginners; a guide for perfected.