He returned to the Lonely Mountain following the death of his father Dáin I in TA 2589, he re-founded the Kingdom.
The Dwarves settled in the Grey Mountains to the north west. The son of Thráin I he abandoned the Lonely Mountain in TA 2210. He founded the first kingdom in Lonely Mountain and discovered the Arkenstone. Thorin Oakenshield was the rightful King under the Mountain. In The Hobbit, the Dragon Smaug was held to be the only 'king' of Erebor.
The King under the Mountain was also by right the King of Durin's Folk. The King under the Mountain, also called the King of Erebor, was the hereditary title of the Dwarven ruler who resides at the Lonely Mountain. ' … they grew immensely rich and famous, and was King under the Mountain again, and treated with great reverence by the mortal men who lived to the South, and were gradually spreading up the Running River as far as the valley overshadowed by the Mountain.' - Thorin relating the outcome of his grandfather's return to Erebor