He became the Sultun of Kedah in September 1803 upon the forced abdication of his paternal uncle Sultan Dziaddin Mukarram Shah II.
He was recognised as ruler of Kedah by the King of Siam, and installed at the Balai Besar, Kota Star Palace, Alor Star, on 19 September 1804 with the title of Phaya Ratna Sangrama Ramabhakti Sri Sultan Muhammad Ratna Raja Varman.
On hearing about a planned invasion of Siam by Burma in 1820, he refused to dispatch the annual bunga mas tribute to Bangkok and opened negotiations for a Burmese alliance.
The British authorities granted the Sultan asylum and a pension, allowing him to live in exile, first at Penang, and later at Malacca.
Arab leaders employed a two-pronged approach of religious militancy and diplomacy to free Kedah from Siamese rule, among which the Jamallulail family played a leading role in these efforts and often carried out negotiations to persuade the Siamese to regain the state's independence.