Inhabited by the Illyrian tribe of the Albani, in 1190 Krujë became the capital of the first autonomous Albanian state in the middle ages, the Principality of Arbër. Later it was the capital of the Kingdom of Albania, while in the early 15th century Krujë was conquered by the Ottoman Empire, but then recaptured in 1443 by Skanderbeg, leader of the League of Lezhë, who successfully defended it against three Ottoman sieges until his death in 1468.
The Ottomans took control of the town after the fourth siege in 1478, and incorporated it in their territories. A 1906 local revolt against the Ottoman Empire was followed by the 1912 Declaration of Independence of Albania.
The museums of Krujë include the Skanderbeg museum and the national ethnographic museum. The Skanderbeg museum, founded in 1982, was built in the environs of the Krujë castle. Its collection includes mostly 15th century artifacts related to the Albanian-Ottoman wars, during which the castle was besieged four times by the Ottoman army. The national ethnographic museum of Krujë was founded in 1989 and is located in a 15–6 room villa of the Toptani family built in 1764. The main exhibits of the museum are objects of artisanship, whose age varies from 60 to 500 years.
The name of the city is related to the Albanian word kroi meaning "fountain". In Albanian the city is known as Krujë or Kruja. In Byzantine documents of the early 7th century it has been attested as Kroai (in Greek Κροαί), while in medieval Latin it was known as Croia, Croya and Croarum. During the Ottoman era it was also known as Ak Hisar or Akçahisar from the Turkish words ak (white) and hisar (castle).
In antiquity Krujë was a site used for pagan rituals, while after the spread of Christianity a church dedicated to Saint Alexander was built near Mount Krujë. In the late 9th century David of Krujë is mentioned as one of the bishops, who participated in the Fourth Council of Constantinople.
In Illyricum Sacrum Daniele Farlati documented fourteen Catholics bishops of the town from 1286 to 1694, while Konrad Eubel documented four additional bishops. Bektashism was introduced in the region of Krujë in the early 18th century.