In Shiva Mahapuran, ShathRudra Samhitha chapter it explained about how Achaleshwar Lingam came into existence.
Shiva’s Incarnation as Yatinath
There used to live a couple named Aahuk and his wife Aahuka. Both of them were supreme devotee of lord Shiva. Once, lord Shiva wanting to test their devotion, appeared before them disguised a hermit as Yatinath. Aahuk honored his guest and treated him very well. Lord Shiva then requested him to give shelter for the whole night. Aahuk expressed his inability as he had a very small hut, in which only two people could be accommodate at a time. But his wife intervened and requested Aahuk to sleep outside the hut, as it would be inappropriate on their part to miss this chance of proving their hospitality. The hermit, who in reality was lord Shiva slept with Aahuk’s wife inside the hut, while Aahuk himself slept outside the hut. Unfortunately Aahuk was killed by a wild animal while he was asleep.
Both Aahuk and Aahuka meet the Death
In the morning when lord Shiva found that Aahuk had died, his heart was filled with grief. But Aahuka consoled him by saying that she was proud of her husband as he had given up his life for a noble cause. Naturally she was very much saddened by her husband’s death so she decided to give up her life by jumping into the burning pyre.
Lord Shiva Blesses Both to attain Shiva Lokha after one more birth
Right then lord Shiva appeared in his real form and blessed her by saying “In his next birth your husband would take birth in a royal family. He would become famous as Nala and you would be born as Damayanti to king Bheema of Vidarbha. I would myself appear in the form of a swan and help both of you to unite. After enjoying all the pleasures of this world both of you would attain to my abode. After saying thus, lord Shiva established himself as immovable Shivalingam, which later on became famous as Achaleshwar lingam.