History of rail transport in Indonesia

Most railway lines in Indonesia were constructed during the Dutch colonial rule. After independence in 1945, many lines were abandoned. The current national rail operator, PT Kereta Api Indonesia (Persero), was founded on 28 September 1945.

First railway line
Indonesia (Dutch East Indies) was the second country in Asia to establish a rail transport, after India; China and Japan were next to follow. On 7 June 1864, Governor General Baron Sloet van den Beele initiated the first railway line in Indonesia on Kemijen village, Semarang, Central Java. It began operations on 10 August 1867 in Central Java and connected the first built Semarang station to Tanggung for 25 kilometers. By 21 May 1873, the line had connected to Solo, both in Central Java and was later extended to Yogyakarta. This line was operated by a private company, Nederlandsch-Indische Spoorweg Maatschappij (NIS or NISM) and used the gauge. Later construction by both private and state railway companies used the gauge.

The liberal Dutch government of the era was then reluctant to build its own railway, preferring to give a free rein to private enterprises. However, private railways could not provide the expected return of investment (even NIS required some financial assistance from the government), and the Dutch Ministry of Colonies finally approved a state railway system, the Staatsspoorwegen (SS), extending from Buitenzorg (now Bogor) in the west, to Surabaya in the east. Construction began from both ends, the first line (from Surabaya) being opened on 16 May 1878, and both cities were connected by 1894.

By the 1920s, the system in Java had reached its greatest extent, with most towns and cities connected by rail, with branches and tramways connecting sugar plantations to factories.

The Great Depression of the 1930s put laid to plans of constructing railway lines in Borneo, Celebes, connecting the lines in Sumatra and electrification of the lines in Java.

After the Dutch state started railway construction, private enterprises did not completely get out of the picture, and at least 15 light railway companies operated in Java. These companies operated as "steam tram companies", but despite the name, were better described as regional secondary lines.

Java
As befits a colonial enterprise, most railway lines in Indonesia had a dual purpose: economic and strategic. In fact, a condition for the financial assistance for the NIS was that the company build a railway line to Ambarawa, which connected to the one of an important military base named Fort Willem I for the Dutch king. The first state railway line was built through the mountains on the southern part of Java, instead of the flat regions on the north, for a similar strategic reason. The state railway in Java connected Anyer on the western coast of the island, to Banyuwangi on the eastern coast.

Sumatra


In Sumatra, railways were first used for military purposes, with a railway line connecting Banda Aceh and its port of Uleelhee in 1876. This railway, the Atjeh Staats Spoorwegen (ASS), first built to a gauge which was later regauged to  and extended south. This line was only transferred to the Ministry of Colonies from the Ministry of War on 1 January 1916, following the relative pacification of Aceh.

The Western Sumatra's state railway in the Minangkabau area, the Staatsspoorwegen ter Sumatra's Westkust (SSS) transported coal from inland mines to the port at Padang and was built between 1891 and 1894

The Southern Sumatra's state railway, the Staatsspoorwegen op Zuid-Sumatra (ZSS), was completed in the 1930s. It served a fertile plantation area and an important coal mine.

Another important private railway line was the Deli Spoorweg Maatschappij (DSM). This line served regions producing rubber and tobacco in Deli.

Sulawesi
Between July 1922 and 1930, a 47 km-long railway line operated in South Sulawesi. This line was to be extended to North Sulawesi, as part of a massive project of railway construction in Borneo and Sulawesi, connection of separate railway systems in Sumatra and electrification of the main lines in Java. The Great Depression of 1929 put paid to these plans.

Japanese occupation
During the Japanese occupation between 1942 and 1945, the different railway lines in Java were managed as one entity. The Sumatra systems, being under the administration of a different branch of the Japanese armed forces, remained separate.

The occupiers also converted the ( lines in Java into, thereby resolving the dual gauge issue. This was not an actual "problem" as there was not much transfer of materials between the systems, and much of the system had been fitted with a third rail by 1940, creating a mixed-gauge railway. Many locomotives were seized and transported to Malaya, Burma and elsewhere. The railway network was reduced from 6811 km in 1939 to 5910 km in 1950 in order to provide material for railway construction in Burma.

Independence era
During the war for independence between 1945 and 1949, freedom fighters took over the railways, creating the first direct predecessor to today's PT Kereta Api, the Djawatan Kereta Api Repoeblik Indonesia (Railway Bureau of the Republic of Indonesia), on 28 September 1945. This date, not the 1867 one, is regarded as the birth date of Indonesian railways and commemorated as Railway Day every year, on political grounds.

On the other hand, the Dutch by Netherlands Indies Civil Administration (NICA) formed their own combined railway system to manage the railway lines located on their occupied territory, the Staatsspoorwegen/Verenigd Spoorwegbedrijf (SS/VS or Combined Railways). This company consisted of a combined state-owned and many private-owned railway companies, except Deli Spoorweg Maatschappij (Deli Railway). By the time of Dutch recognition of Indonesian independence, the SS/VS had most railway lines under their management, though not all were in operation.

With Indonesia's full independence in 1949, the separate systems (except the Deli Railway) were combined into the Djawatan Kereta Api. Non-state railway systems in Java retained their paper existence until 1958, when all railway lines in Indonesia were nationalized, including the Deli Railway, thereby creating the Perusahaan Negara Kereta Api (PNKA: State Railway Corporation) in 1963. On 15 September 1971 the name of PNKA was changed to Perusahaan Jawatan Kereta Api (PJKA, the Indonesian Railway Systems). Later then, on 2 January 1991, PJKA was changed its name and status as Perusahaan Umum Kereta Api (Perumka, the Indonesian Railways Public Company), and since 1 June 1999, this company was changed to a limited company, PT Kereta Api (Persero) (PT KA). In May 2010, the name of "PT KA" was changed to PT Kereta Api Indonesia (Persero) (PT KAI, The Indonesian Railways Company) till present.

The headquarters of the state railway system, since Dutch colonial days, had been located in Bandung, West Java. Private railway companies were headquartered elsewhere, in Semarang, Tegal, Surabaya and Medan.

Construction of new railway lines has been scarce. In 1997, a line was inaugurated from Citayam to Nambo in West Java. At the beginning, this line was planned to be incorporated into a larger circular line network, ranging from Cikarang to Parung Panjang. This plan had to be postponed due to the 1997 economic crisis. The first airport rail link in Indonesia, the Kualanamu Airport Rail Link, connects Medan with Kualanamu International Airport, which was inaugurated on 4 September 2013. The Soekarno–Hatta Airport Rail Link was opened between Soekarno–Hatta International Airport and BNI City on 26 December 2017. Minangkabau Ekspres, connecting Minangkabau International Airport and Padang, was inaugurated on 21 May 2018. The Adisumarmo Airport Rail Link, connecting Adisoemarmo International Airport station and Solo Balapan, opened on 29 December 2019. Yogyakarta International Airport Rail Link, connecting Yogyakarta International Airport with Yogyakarta was completed in September 2021. The Trans-Sulawesi Railway are built with standard gauge which is wider than the  cape gauge used in Java and Sumatra to accommodate more weight and speed,  the first phase includes 146 kilometers route from Makassar to Parepare, which was completed in November 2022 and has been operating ever since, the total plan for the railway would be around 2,000 kilometres spanning from Makassar to Manado, most of other sections are still under construction.

Most new construction is concentrated on double- and quad-tracking of existing railway lines. In 2011, double-tracking of the line from Semarang to was begun. The project was finished with the double-tracking of the final segment between and Surabaya Pasar Turi on 8 May 2014. The line between Manggarai and Cikarang on Rajawali-Cikampek line is being quadrupled, with the first section between Jatinegara and Cakung opened on 14 April 2019.

Trams formerly existed in Jakarta, Surabaya, Malang, and Semarang before their service was closed after independence. In Jakarta the tram lines are operated using track gauge operated by Bataviasche Verkeers Maatschappij and Pengangkutan Penumpang Djakarta, while in other areas track gauge  were used. In Greater Jakarta, KRL Commuterline and Jabodebek LRT is operational urban rail network, serving commuter routes which comprises cities of DKI Jakarta, Depok, Bogor, Bekasi, Tangerang, and South Tangerang as well as regencies of Bogor, Bekasi, and Lebak. The other operational urban rail networks are Jakarta provincially-owned Jakarta MRT, Jakarta LRT, and Soekarno-Hatta Airport Rail Link to support the public transport network in the area.

Indonesia operates a high-speed rail line connecting its two largest cities, the Jakarta–Bandung high-speed rail line, which will allow trains to reach up to 420 km/h, with operational speed of 350 km/h. Commenced operations on October 2, 2023, this High Speed Rail line is the first in Southeast Asia

List of defunct railway in Indonesia
Defunct railway in Indonesia are railway lines that once existed and were used as passenger transportation and/or freight transportation in Indonesia, but are now no longer functioning, and in some places, there are even no traces of them anymore.

According to data from the Ministry of Transportation of the Republic of Indonesia as of 2017, there are 2,723 kilometers of inactive railway lines in Indonesia out of a total of 8,157 kilometers that were in operation as of 1939. So that within a period of 78 years (1939-2017), there is a tendency for a decrease in the infrastructure of the operated railway lines.

The tabulation of railroad lines is based on their crossing numbers in the Buku Jarak untuk Angkutan Barang Jawa dan Madura (Distance Book for Goods Transportation in Java and Madura) published by PJKA in 1982, unless otherwise stated.

Pre-independence inactivity
There are railroad lines that were successfully reactivated by Djawatan Kereta Api Republik Indonesia (DKARI) in the early days of independence. This reactivated line is considered important and has high economic potential so it needs to be reactivated. In addition, there are railroad lines that are considered important for military movements. However, among the lines that DKARI successfully reactivated, many of them were deactivated for the second time in the 1970s to 1990s in the PJKA era.