Leeds Crown Court heard residents became suspicious after seeing people coming out of the property in East End Park carrying plants.
Further suspicions were aroused when people were seen leaving the property via a top floor window.
West Yorkshire Police officers attended the address, found cannabis plants growing throughout the property and arrested Dhiren Patel.
Leeds Festival road closures: Aberford village will be closed to festival traffic after being used as a 'rat run'
Man dead after a paragliding accident near to Leeds
Leeds United supporters issued warning not to walk on M621 after minibus drops fans off on motorway slip road
'Highly organised' Leeds thieves caught by own technology after tracking movement of business owners
Leeds drug farmer locked up after being handed 'lenient' sentence
Patel was also found in possession of cocaine.
The court heard the plants were capable of producing 4.7kg of the class B drug, with a potential street value of £48,000.
Patel, of Glensdale Terrace, pleaded guilty to permitting premises to be used for the production of cannabis and possession of cocaine.
Probation officer Mick Berry described Patel as "naive" and "out of his depth" when he allowed others to use his home to grow cannabis.
The court heard Patel had mental health difficulties at the time of the offending.
Patel was given a 17-month prison sentence, suspended for 12 months.
He was made the subject of an electronically-tagged curfew order for four months.
Judge Penelope Belcher said: "The serious aggravating feature here is the sheer quantity of the cannabis.
"People who supply this drug need a place to harvest it and you provided it.
"Drugs have an appalling impact on people and the community at large.
"Do not kid yourself that cannabis is an easy drug or a good drug - it is not."