Rarotonga has long been considered the capital of the Cook Islands. Numerous legends across eastern Polynesia touch upon the early existence of Rarotonga, and there was undoubtedly regular contact between the island and the rest of the South Pacific (particularly the islands of French Polynesia).
Traditional oral history relates that the first person to discover Rarotonga was Io Tangaroa from Nuku Hiva in the Marquesas Islands, now part of French Polynesia. He came by canoe about 1400 years ago, but didn't stay; he went back to Nuku Hiva and never returned to Rarotonga. But he told his people about the new land and his sons and grandsons later visited. Io Tangaroa's son, Tongaiti, gave the island its first name: Tumu Te Varovaro (Source of the Echo).
Settlers from the Marquesas and nearby Society Islands were the first people to establish a permanent home on the island, but little is known about this early period in Rarotonga's history; the only real historical anchor is the construction of the Ara Metua inland road, also called Te Ara Nui o To'i (The Great Road of To'i), somewhere around the 11th century, though no-one today knows precisely who To'i was.
The island's traditional history begins with the arrival of two great warrior chiefs, Tangi'ia from Tahiti and Karika from Samoa, who arrived in huge vaka (ocean-going canoes) and quickly conquered the island, later founding the island's six tribes. The district of Ngatangi'ia (in the southeast) still bears Tangi'ia's name, and Takitumu was named after his canoe. Karika settled near present-day Avarua.
Conflicts and wars were quite common among these tribes; people didn't live on the low coastal plain as they do now - they lived at higher elevations where they could better defend themselves, only venturing down to the sea in armed groups for fishing. Inland, they grew crops and raised livestock.
Somewhere between 1000 and 1400, vaka set out south from Rarotonga in search of New Zealand, which had been discovered in around AD 800 by Kupe, an early Polynesian navigator. The people on these canoes became the great ancestors of the New Zealand Maori tribes; many of the tribes still bear the names of the canoes on which the settlers arrived (the Tainui tribe and Te Arawa tribes, for example).
Interestingly, considering its size and historical importance, Rarotonga was one of the later islands to be found by Europeans. It's thought that the first European sighting was probably by the mutineers on the Bounty, who happened upon Rarotonga in 1789 after the mutiny while they were searching for a hideout (preferably as remote as possible).
The first known European visitor was Philip Goodenough, captain of the Cumberland, who showed up in 1814 and spent three months supposedly searching for sandalwood, although he seems to have spent more time skirmishing with the locals. Several of his crew were killed during the bloody squabbles, including Goodenough's female companion, Ann Butcher (the first European woman on the island), and eventually the Cumberland fled for safer shores.
In 1821, the Reverend John Williams of the London Missionary Society (LMS) set off in search of Rarotonga from Aitutaki, where his disciple Papeiha, a missionary from Ra'iatea in the Society Islands, had had remarkable success converting the islanders to Christianity. Williams and his companions bounced around most of the islands of the Southern Group (including Mangaia, Ma'uke, Mitiaro, and 'Atiu) for the next couple of years, but never quite managed to find Rarotonga. Eventually an 'Atiuan ariki (high chief), Rongomatane, whose people had invaded Rarotonga on numerous occasions, gave the missionaries directions and they finally landed in 1823.
Williams spent several years preaching on Rarotonga, ably assisted by Papeiha, Pitman and another missionary called Aaron Buzacott, before eventually meeting his end in a cannibal oven in 1839 on the island of Vanuatu. As on Aitutaki, they succeeded with surprising speed; a little more than a year after their arrival, Christianity had taken a firm and lasting hold on the island.
The first permanent missionaries came in 1827. They translated the Bible into Maori, and established 'Arorangi as a model for new villages on the island; the missionaries were keen to relocate the newly converted islanders in order to break ties with their old religion. Rarotonga became the Cook Islands' headquarters for the LMS and an important administrative and religious centre.
As elsewhere in the Pacific, previously unknown diseases took a devastating toll on the islanders, and the population had more than halved within twenty years of the missionaries' arrival. It only really started to recover around the turn of the century.
Although the missionaries tried to exclude other Europeans from settling, whalers and traders visited the island - as one missionary's wife lamented, men of 'some wealth and little religious principle'. Unable to deter the traders, the missionaries did at least warn the Rarotongans to beware the French, who had taken over Tahiti in 1843. The prospect of a French (ie Catholic) invasion made the missionaries extremely skittish, and in 1865 they convinced the paramount ariki, Makea Takau, to request British protection for the first time. This initial request was turned down, but after several further requests, the Southern Group was finally declared a British protectorate, and Rarotonga became the unofficial capital of the Cook Islands.