Rivendell, or Imladris, was an Elven town in the Misty Mountains on the eastern edge of Eriador. Because of its location, it was called 'The Last Homely House East of the Sea' from the point of view of a traveler going to the Misty Mountains and Wilderland; and also the First Homely House from the point of view of someone coming from these lands to the civilized lands of Eriador to the west.
It was established by Elrond in S.A. 1697 as a refuge from Sauron after the fall of Eregion. It remained Elrond's seat throughout the remainder of the Second Age and until the end of the Third Age, when he took the White Ship for Valinor. Rivendell had a strong alliance with the Kings of Arnor and after the fall of Arthedain it became a refuge for the Rangers of the North and the heirs of Isildur. Besides Elrond himself, notable Elves who lived there included Arwen and Glorfindel.
Rivendell was located at the edge of a narrow gorge of the Bruinen River, but well hidden in the moorlands and foothills of the Misty Mountains.
During the War of the Elves and Sauron, and as Sauron was moving against Eriador, Elrond led an army of Elves of Lindon to the region. They arrived late but were joined by a detachment out of Eregion led by Celeborn. Despite this, Sauron's armies overwhelmed the Elves, and Elrond was unable to reach Eregion. Forced northward toward the headwaters of Bruinen, Elrond established a stronghold.
This became a refuge for those seeking shelter from Sauron's onslaught in Eriador, and Elrond's and Celeborn's Elves were soon joined by many fleeing the Sack of Eregion. More came as Sauron ravaged Eriador on his march toward Lindon. By S.A. 1700, Sauron had overrun all of Eriador and Imladris was besieged. The siege ended when Gil-galad's forces, strengthened by the armament sent by Tar-Minastir, routed Sauron's armies and drove him out of Eriador.
A Council held at that time made Elrond Gil-galad's vice-regent in Eriador, and Imladris his seat. Gil-galad bestowed Vilya upon Elrond in secret. Aided by the power of the Elven ring, Elrond made Imladris one of the chief seats of Elvish strength in the west in the latter part of the Second Age. Imladris remained an Elvish stronghold in Eriador to the end of the Second Age and into the Third.
At the end of the Second Age, Elendil and Gil-galad formed the Last Alliance of Elves and Men to challenge Sauron, and their host halted for a while at Imladris before crossing the Misty Mountains. Isildur's wife and his youngest son, Valandil, were in Imladris at that time, and Isildur was journeying back to them after Sauron's defeat when he was ambushed at the Gladden Fields. After receiving the shards of Narsil, Valandil took up his role as King of Arnor and left Imladris for Annúminas.
After the fall of Gil-galad, Elrond remained in Imladris. During the Third Age it was a refuge and sanctuary; many Elves gathered there, and it was the chief dwelling of the High Elves in Eriador. The heirs of Isildur were also harbored there due to their kinship with Elrond, as descendants of his brother Elros. Rivendell maintained this relationship with the North Kingdom throughout the Third Age, and Elrond and his people remained steadfast allies to the heirs of Isildur. Situated on the western slopes of the Misty Mountains, Imladris was near Arnor's eastern province of Rhudaur, which became independent during the disintegration of the North Kingdom in T.A. 861.
Danger came to Eriador around T.A. 1300 when the witch-kingdom of Angmar was established in the north-east beyond the Ettenmoors. It was late in the reign of Arveleg I that Rivendell was besieged by Angmar. After an incursion by Angmar into Eriador in T.A. 1409, the Elves of Rivendell joined those of Lindon in subduing the power of the Witch-king for many years.
After the end of the North-kingdom in T.A. 1975 Aranarth, the first Chieftain of the Dúnedain, had his son fostered in Rivendell, as were all subsequent sons of the chieftains. The heirlooms and treasures of the house of Isildur, including the shards of Narsil, were also kept there after Arvedui's death. Among these were also some of the few remaining documents containing the history of Númenor.
There was traffic across the Misty Mountains in the Third Age between Imladris and Lórien, for Elrond's wife was Celebrían, daughter of Galadriel and Celeborn.
In the Quest of Erebor, Bilbo Baggins stopped off at Rivendell with the Dwarves on the way to the Lonely Mountain and also on the way back to the Shire with Gandalf. Bilbo retired there after his 111th birthday, writing his memoir There and Back Again.
War of the Ring
Years later, Frodo Baggins and his companions journeyed to Rivendell, where they met Bilbo. Several other Elves, Dwarves and Men had also arrived at Rivendell on separate errands; at the Council of Elrond they learned that all of their errands were related to the fate of the One Ring, and they had to decide what to do about it. In the end, the Hobbits influenced the decision.
Pine-trees grew on the top of the valley, and there was a 'steep zig-zag path' to the valley bottom. The vegetation in the valley bottom was mostly oak and beech.
Rivendell ('cloven-dell') is the Common Speech translation of the Sindarin name Imladris ('deep dale of the cleft'). An alternative (or complementary) etymology, gives Rivendell as the Englished version of the Westron name Karningul (itself a translation of Imladris).
The name Imladris is also glossed as 'Canyon of the Cleft' and 'flat-floored valley of the Cleft'.
A possible inspiration (so suggested by David Salo) could have been Lauterbrunnen, Switzerland, which Tolkien visited in 1911:
“I am... delighted that you have made the acquaintance of Switzerland, and of the very part that I once knew best and which had the deepest effect on me. The hobbit’s journey from Rivendell to the other side of the Misty Mountains, including the glissade down the slithering stones into the pine woods, is based on my adventures in 1911 (he was 19 and traveled to Lauterbrunnen)... Our wanderings mainly on foot in a party of 12 are not now clear in sequence, but leave many vivid pictures as clear as yesterday.' (He talks of similar conditions of the travel of Bilbo camping out, walking mountain paths, carrying packs).” ― Tolkien