The Doors were constructed in cooperation with the artificers of the Elven-kingdom of Hollin, some time between SA 750 and SA 1500. These were the days before Sauron's dominion in Middle-earth, and the friendship between Elven and Dwarven kingdoms was a rare and special event. During this peaceful time, the Doors stood open, allowing unfettered trade. But with the beginning of the War of the Elves and Sauron the Doors were shut.
The two greatest craftsmen of the Second Age, the elf-lord Celebrimbor and the Dwarf Narvi, built the Doors. They were made like a flush door, the jambs invisible to the eye, and matched so perfectly with the mountain rock that, when closed, the Doors could not be seen. The slabs were made by Narvi out of grey material stronger than stone and inlayed by Celebrimbor with Ithildin, which can only be seen in starlight and moonlight; when visible, the fine silver-like inlay showed a hammer and anvil (emblems of Durin), a crown and seven stars, two trees surmounted by crescent moons, and a single star (the emblem of the House of Feanor)- the inscription on the archivlot read:
"Ennyn Durin Aran Moria. Pedo mellon a Minno. Im Narvi hain echant. Celebrimbor o Eregion tethant. I thiw hin"
("The Doors of Durin, Lord of Moria. Speak friend and enter. I Narvi made them. Celebrimbor of Hollin drew these signs.")
Third AgeEditWhen Khazad-dûm was abandoned in TA 1981 due the rise of the Balrog the way of opening the Doors was forgotten and the Doors were closed. During the Quest of the Ring, the Fellowship approached the Doors and attempted to enter Moria from there. At first Gandalf was unsuccessful at opening the Doors. The inscription was a riddle. The answer was a password that would cause the Doors to swing open. Gandalf eventually solves the riddle, remembering the Sindarin word for friend, "mellon".
When entering, the Watcher in the Water grabs Frodo's ankle to drag him into the lake. Sam slashes the tentacle with his knife, causing it to release Frodo and retract. The Fellowship runs into the mines while The Watcher slams the Doors behind them. A great noise is heard of stone and rock being thrown behind the Doors, and Gandalf believes that the two great holly trees on either side had been uprooted and thrown across the Doors.