In 1814, as imperial governor of Java, Raffles heard tales of a mysterious lost temple buried under volcanic ash, and ordered his soldiers to Magelang to start hacking through the dense jungle. It took three months for the towering structure to emerge.
Now, in the misty darkness, I followed my guide Udin up Borobudur's nine terraces, which are like the tiers of a vast square wedding cake. Near the top, Udin pointed out the best vantage point and we sat in silence facing eastward to Mount Merapi, one of nine volcanic mountains that surround the valley, to watch the dawn.
There would be no red sunrise this morning, but no matter. The silhouettes of 500 life-sized stone Buddhas emerged slowly under a slate blue sky. To sense the full serenity of this place at daybreak, with only the swallows fluttering overhead, was heavenly.
Built around AD780, during the Sailendra dynasty when both Buddhism and Hinduism flourished in Java (Islam eclipsed both in the 15th century), Borobudur is far more than another piece of ruined antiquity on the Asian travel trail.
The site is a living "mandala'' - or diagram - its shapes and pathways codes for the Buddhist conception of the cosmos. The scale and harmony are mesmerising. But the pilgrim also gets a walking meditation: a literal path to enlightenment.
The idea is to walk around each of the nine levels a set number of times; and as you move from the labyrinthine lower corridors to the circular open terraces at the top you are imbued with an understanding of how worldly desires are what are coming between you and happiness. By the uppermost level, which is topped by a monumental stupa, you should be filled with peace - nirvana.
Udin, although like most Javanese - and 90 per cent of today's Indonesians - a Muslim, outlined the philosophy as we moved from the security checks at the entrance (Borobudur was damaged by Islamist bombs in 1985) to the base. "This place is like a university. You could spend months here,'' he said reverentially. "It is an education.''
He was right: I became fascinated by the parables on the 1400 stone bas reliefs that fill the lower galleries. A bird sits on a branch in one scene. Fire breaks out but the bird stays put. When the other forest creatures return they ask: "Why did you not flee like us?'' "I controlled the fire in my heart by not being afraid,'' the bird replies. "The message,'' said Udin, "is you must burn your anger before it can burn you.''
On-again off-again political instability, and the overwhelming lure of nearby Bali, mean few Westerners choose to holiday in Java, Indonesia's most populated island, when they come to the archipelago. It's a great mistake because the landscapes and cultures of central Java are as charming and exotic as the paradise islands to the east and - even amid rapid economic growth - more authentic.
To reach Borobudur, I had flown an hour south of the Indonesian capital Jakarta to Yogyakarta. There's a lot to see in "Jogja'' as everyone calls this lively city, renowned for culture and fine art and which is, thanks to a constitutional quirk in Indonesia's democracy, still governed by a sultan.
A short trip north proves Java's rich religious heritage with the massive 9th-century Prambanan temple complex, one of the most important Hindu sites in South-east Asia. Hinduism was Indonesia's main religion for 1000 years, and while Java has been majority Muslim for centuries, it is an Islam that's still influenced by elements of Hinduism and Buddhism.
From Yogyakarta, after a meal of beef rendang, the local speciality, and a satisfying hour of batik buying (traditional cloth) at the Meropi emporium on Malieboro, the main street, I set off for the hills to the east.
Busy roads, lined with "warung'' (small cafés selling nasi goreng or fried rice), soon gave way to lush green rice paddies and quaint bamboo farmhouses. Young women in jeans and flip-flops zoomed past on scooters, often with a child or a birdcage, or both, on the back. Families clip-clopped at a leisurely pace on their andong (pony and trap).
My destination was Amanjiwo, a hotel whose name means "peaceful soul''. A young man in the nearest village confided that local people were baffled by the hotel's appeal, because for all its reputed luxury and spectacular views of Borobudur, Amanjiwo guests had neither television nor a karaoke bar.
That may be, but architecturally inspired by Borobudur and set idyllically in foothills of rice fields and coconut groves, the hotel is a draw for well-heeled Asians seeking discreet opulence, just as the temple was a spiritual magnet for their pilgrim ancestors.
Everything, from the pared-down Javanese decor to having your own assistant, is balm to the weary body and, possibly, the soul. My suite had a domed roof, a walled garden, a thatched bale or pavilion with daybed for reclining or feasting on room service, and a private infinity pool.
It took half a day to realise there was a separate dressing area for a spouse. And opening yet another sliding door I found a courtyard with a stone tub big enough to accommodate me and my imaginary husband, should we have wanted to bathe by moonlight.
I could imagine Sir Stamford Raffles, gin and tonic in hand, in a teak armchair on the colonnaded terrace, looking out at the rainforest canopy round his lost temple, eagles swooping overhead. But then he might never have torn himself away to find it (or the exquisite Buddha head he pinched, now in the British Museum).
I tore myself away to walk through country lanes into the Menoreh hills and was nodded and smiled at by sarong-wearing farmers, produce balanced on their heads.
The hotel can arrange excursions - including one to a tofu-making village - or provide you with a bicycle, a guide, or just a map.
On another outing I saw the tiny Buddhist temples of Mendut and Pawon, both unmissable points on the ancient pilgrims' journey to Borobudur and although 3km away from the main temple, thought to be part of the original compound.
A village pasar, or market, showed the abundance of the land: peanuts, chilli, cloves and all manner of tropical fruit (soursop, anyone?), or spare parts for a motorbike. I settled for a rice spoon carved from coconut shell for about 60 cents. On the way back, I passed labourers in the emerald fields wearing conical bamboo hats and baskets suspended from carrying-poles across their shoulders.
Back at Amanjiwo, on the eve of my sunrise pilgrimage, I succumbed to the siren call of a two-hour spa treatment, designed, apparently, for a sultan's bride. Even for a commoner, being massaged then scrubbed with rice grains, honey and white turmeric, before being smeared with hot yoghurt and eventually led to a moonlit herb bath strewn with rose petals, felt pretty good.
But was such indulgence - so close to a shrine devoted to ending the struggle with material comforts - so sinful it could bar me from finding nirvana? A 1300-year-old carving at Borobudur's base (where the evils of desire are depicted) has a pampered individual enjoying a massage. In the next frame, the masseurs are crowned with riches. But after squandering their wealth on partying, they are in turn punished by being reborn with ugly faces.
"What happened to the person who enjoyed the massage?'' I quizzed Udin. "I don't know, Ibu, because that's not the point,'' he replied. And why, I pressed him, is dancing and drinking so harshly punished? Udin paused. "We are talking about balance,'' he answered calmly. "This message is about controlling your desires, so they don't control you.''
- INDEPENDENT