Charles Mumbere, the king of Rwenzururu, is entitled to these privileges because he suffers from hypertension and diabetes, it added.
But prison authorities say an outsider will not be allowed into the prison to prepare his meals.
The king was arrested last month after a security force raid
on his palace in western Uganda's Kasese district. More than 80 people were killed in the clashes.
The 64-year-old monarch denies any involvement in violence. He was arrested with more than 150 people, including royal guards.
His lawyer, Caleb Alaka, told the BBC he will ensure that prison officials comply with the court order.
Mr Alaka said he initially thought there was a royal cook among those arrested but they had all "perished" during the raid on the palace.
The monarch would accept a cook appointed by prison authorities, he added.