Sign In

First Railway in Java: Semarang to Tanggung, Finished 1867

The first railway in Java began at Semarang in 1867

The first railway in Java was the line of roughly 25 kilometres from Semarang to Tanggung, which opened on 10 August 1867. It was built by the Nederlandsch-Indische Spoorweg Maatschappij (NIS), a private railway company working under a concession from the colonial government. The line began at Kemijen in Semarang and pushed inland to Tanggung, in what is now Grobogan Regency. It was the first completed section of a much longer railway intended to connect the port of Semarang with the inland royal cities of Surakarta and Yogyakarta.

That distinction matters: the 1867 milestone marks the opening of the Semarang–Tanggung section, not a train journey all the way to Yogyakarta. Construction advanced in stages. Tanggung was connected to Kedungjati in 1868, the line reached Surakarta, better known today as Solo, in 1870, and the link to Yogyakarta followed in the early 1870s. The short opening section was therefore the beginning of Java’s railway system, rather than the finished cross-island route people sometimes imagine when they hear “first railway”.

Why the railway started in Semarang

Semarang joined a fertile inland agricultural region to a port on Java’s north coast. Before the railway, produce from the interior had to travel by road and river, which made the movement of heavy or bulky goods slow and costly. A railway offered a fixed corridor that could carry both freight and passengers between the coast and the interior, and the colonial government saw rail as the answer to the problem of moving the harvest to the ports.

The commercial case was closely tied to plantation produce for export. These goods were grown and processed inland and needed to reach the coast for shipment overseas. A line beginning in Semarang could serve two linked tasks: move produce towards the port and give passengers a new way of travelling in the same direction. It was not a transport novelty laid down for its own sake; the route was designed around the relationship between inland production and maritime trade.

The wider plan aimed at the Vorstenlanden, the Dutch colonial name for the princely territories around Surakarta and Yogyakarta. Those lands were among the most productive in Java, and linking them to Semarang’s harbour promised steady traffic. These aims belong to the colonial system that authorised and controlled the railway, and the line’s story cannot be separated from the export economy it was built to serve.

Who built the Semarang–Tanggung line

The concession for the railway was granted to three businessmen, W. Poolman, Alex Frazer and E.H. Kol, and the work was carried out by the NIS company formed to build it. The first ground was broken at Kemijen on 17 June 1864, and it took about three years to complete the line to Tanggung. The railway was thus a private-company project operating within a colonial concession, not a public works scheme of an independent state.

Building a railway in the 1860s meant clearing a route, raising embankments, laying sleepers and rails and putting up stations along the way, almost entirely by hand. The project depended on a large local workforce, and the people who built it came from the surrounding region rather than from overseas. A useful account of the railway includes that labour as well as the company and its directors.

Historical spellings can make the names look unfamiliar. The city appears in older documents as “Samarang” and Tanggung as “Tangoeng”, while the company’s long Dutch name appears in small variations and is often shortened to NIS or NISM. These forms refer to the same places and company. Modern writing usually uses Semarang and Tanggung, which makes the route easier to follow on a present-day map.

Following the route from Kemijen to Tanggung

The starting point was Kemijen in Semarang. From there the line ran inland across the plain behind the city, with stopping places along the way where passengers could board and goods could be loaded. The corridor it opened is still part of the railway network of Central Java, and trains continue to run along the route between Semarang and the interior.

On a modern map, the names can be difficult to match exactly to the nineteenth-century route. Settlements grow, station buildings are rebuilt and track alignments are improved over time. The historic opening date does not mean every surviving rail or station building along today’s railway belongs to 1867. The date identifies the inauguration of the first section and the endpoints associated with that early route.

For a reader tracing the story geographically, Kemijen is the key starting location; Tanggung is the inland terminus of the first section; and Kedungjati, a short distance beyond, is where the line was extended next. Thinking in these three points avoids confusing the 1867 line with the entire later network. It was a working corridor whose stations served passengers and freight as the railway pushed inland.

What changed between 1867 and the line to the royal cities

After the first section opened, the railway grew in separate construction stages. The Semarang–Tanggung section opened in August 1867, and Tanggung–Kedungjati followed in July 1868. From Kedungjati the line was carried on to Surakarta, which it reached on 10 February 1870; by that year about 110 kilometres of railway were in use. The extension to Yogyakarta followed in the early 1870s. The full Semarang–Vorstenlanden route was therefore a sequence of extensions, not one continuous stretch completed in 1867.

A branch line was also built from Kedungjati to Ambarawa, opening on 21 May 1873. Its terminus, the station then named Willem I, is now the Ambarawa Railway Museum, where steam trains still run on heritage excursions. That branch shows how quickly the network spread beyond the original line once the first section had proved itself.

This sequence helps answer common questions. If someone asks when the first railway in Java opened, 1867 is the answer. If they mean when construction started, building began in June 1864. If the question is when trains first ran from Semarang to Solo, the answer is 1870. These dates describe different milestones: the start of building, the first completed section and the later extensions of the longer route.

Freight, passengers and the railway’s early purpose

Freight and passenger traffic belonged to the same railway, but they reveal different sides of its history. Plantation produce bound for the port shows why a coast-to-interior route made commercial sense. Passengers show that the line was also used for ordinary travel between towns and villages, and stations soon became busy places where porters, traders and travellers gathered.

The railway should not be described as a simple public benefit detached from its colonial setting. It improved the movement of goods and created new passenger connections, while serving an economy shaped by colonial rule and export production. Stating both parts gives a more useful historical picture than calling it either only a technological achievement or only a freight line.

The success of the first line also changed attitudes to railways across the colony. Once the Semarang line had shown that trains could work in Java, other lines followed, and the colonial government’s own railway, the Staatsspoorwegen, later built and ran an extensive network of its own alongside the private company.

How the first line fits into Java’s wider railway history

The Semarang–Tanggung railway established a starting point for a network that eventually reached across the island. From around 25 kilometres in 1867, the network grew to about 110 kilometres by 1870 and kept expanding for decades afterwards, with the private company and the state railway each adding lines of their own.

For travellers considering a cross-island journey today, this nineteenth-century story is historical context rather than a present-day itinerary. The early line does not describe current passenger services, station access or journey times, which are separate and changeable questions. East Java lies further along the island, and Banyuwangi and the Bali ferry mark the crossing from Bali. Neither should be mistaken for the route of the historic Semarang–Tanggung line.

The distinction between Central and East Java matters on a map. Semarang and Tanggung belong to the story of Central Java’s first railway; Banyuwangi lies much farther east and is part of a different travel corridor. The 1867 line points inland from Semarang, whereas the Bali crossing reaches Java at its eastern end. Linking these topics is useful only for a reader planning beyond Bali; it does not make the places adjacent.

Reading the 1867 milestone accurately

When comparing accounts, check what each date refers to. June 1864 marks the start of construction at Kemijen. The date 10 August 1867 marks the opening of the first section, from Semarang to Tanggung. The years 1868 and 1870 mark the extensions to Kedungjati and Surakarta. This staged chronology is the central point.

Distance figures vary slightly between accounts, with 25 and 26 kilometres both quoted for the first section. “About 25 kilometres” is a sound way to describe it without implying that historic and modern measurement conventions produce identical totals. These differences do not change the basic route: the first railway in Java connected Semarang with Tanggung before later construction carried the network farther inland.

It is also worth separating the railway’s historical significance from what can be seen on a visit now. The first ground was broken at Kemijen, but that does not mean an original platform or track from 1867 remains to be seen there. The stations along the old route are working railway buildings, many of them rebuilt over the years, so visit them as part of today’s railway rather than as a preserved museum line.

Questions about Java’s first railway

Was the first railway in Java opened in Semarang?

Yes. The first completed railway section ran from Semarang to Tanggung and opened on 10 August 1867. Construction had begun at Kemijen in June 1864.

Did the train reach Yogyakarta in 1867?

No. The 1867 opening covered the Semarang–Tanggung section. The route was extended in stages, reached Solo in 1870 and Yogyakarta in the early 1870s.

How long was the first railway section?

About 25 kilometres.

Which company built it?

The Nederlandsch-Indische Spoorweg Maatschappij, usually abbreviated NIS or NISM, built the line under a concession granted by the Dutch colonial government.

Why Semarang remains central to the story

Semarang was both the railway’s coastal starting point and the place from which a major inland connection was planned. The first section made the project tangible: in 1867 the route reached Tanggung, and in the following years it continued towards Solo and Yogyakarta. The city’s position between port traffic and Central Java’s interior explains why the earliest railway here was more than a local engineering experiment.

For a broader journey from Bali into Java, the decision about adding the eastern part of the island to a Bali trip is a separate one. Java’s railway story began here, with a short line inland from Semarang whose 1867 opening is best kept distinct from the later journey to the royal cities.

For more on this area, see Semarang: Colonial Old Town and Temples of Central Java.