The film is based on the true story of Sarawak's first Rajah, Sir James Brooke, who was the inspiration for Rudyard Kipling's famous The Man Who Would Be King and Joseph Conrad's novel Lord Jim. Brooke was a former British soldier who travelled to Borneo in 1839, where he helped the Sultan of Brunei put down a pirate rebellion and was bequeathed the land of Sarawak as his own private kingdom. He was knighted by Queen Victoria but went on to defy the monarch when the British Empire tried to colonise Sarawak. Rajah Brooke's dynasty would last three generations across 100 years.
https://en.wikipedia.org/wiki/Edge_of_the_World_(2021_film)