Danh Nhan Vo, 36, was caught with 362 plants of the drug at his flat in the city’s Ferry Road.
Fiscal depute Dev Kapadia told Edinburgh Sheriff Court Vo was caught after it was reported to police that there was a strong smell of cannabis.
Mr Kapadia said: “A search warrant was granted and officers gained entry to the house and the accused was found inside.”
He added that the total value of the plants was around £54,200. Vo admitted producing the drug in Ferry Road on July 28 this year.
The court heard he pleaded guilty on the basis that he was a gardener. Sheriff Kenneth MacIver deferred sentence until October 18 for background reports. He was remanded in custody.