During its long and varied history the castle was mostly a military fortress, but also functioned as the seat of provincial rulers, with the city tower being used by pipers and fire guards. In spite of all this the role of the castle gradually dwindled, as did the strategic importance of the fortress and walls. It was rescued from total destruction by a governmental decree of 1814 to turn it into a penal institution. In 1905 the castle was bought by the City of Ljubljana.
Since 1988 Ljubljana Urban Municipality has been carrying out continuous archaeological research at Ljubljana Castle. Since the renovation work carried out in the 1980s and 1990s the castle has offered a touristic viewing tower, a virtual museum, a chapel, and several cultural/conference venues - Hribar's Hall, Palatium, Pentagonal Tower, Rocks Hall, Estate Hall, White and Blue Halls, Erasmus Tower, Archers' Tower and Pipers' Tower. Cultural events also take place in the castle courtyard. The castle is managed by Ljubljana Urban Municipality in collaboration with the Festival Ljubljana.
In addition to performing arts events, exhibition projects and film screenings (eg Film under the Stars during the summertime), some permanent exhibitions featuring history of the city are displayed at Ljubljana Castle. Perhaps the most attractive of these is the Virtual Museum - Ljubljana Squares Through the Ages, prepared by the City Museum of Ljubljana and sponsored by the Tobacco Factory, which presents the history of Ljubljana. In this exhibition the urban and architectural development of the city is presented alongside its cultural and economic growth to afford an impression of the life of its inhabitants. Another important permanent exhibition is entitled Settlement of the Ljubljana Basin – the Urban Development of Ljubljana; this explains how the area was settled and the development of the settlement itself from prehistory to the present using drawings, ground plans, projects, photographs, prints and models, and provides a brief survey of the historical periods of Ljubljana.
At the end of year 2006 the Ljubljana Urban Municipality connected Ljubljana Castle with the old city core by an urban means of transport - a funicular railway. The ride up the slope of the castle hill has been included in a regular guided walking tour of the city organised by the Ljubljana Tourist Board. Lower station of funicular railway is located at Krek Square, next to the Dome and the city open-air market place.