A Dublin man said he started growing cannabis to relieve symptoms of anxiety and depression.
Reginald Horton (45) was found with 11 cannabis plants, with a street value of €8,800, after his home was raided.
Judge John Lindsay imposed a five-month sentence.
The defendant, with addresses at Glenview Park and Alderwood Green, both in Tallaght, admitted before Tallaght District Court to cultivating genus cannabis without a licence, as well as possession of cannabis.
The search took place at his home at Glenview Park on October 21, 2012.
The court heard that the DPP had directed summary disposal on a guilty plea only in the district court.
Sergeant Michael Ahern said that gardai obtained a warrant and searched the defendant's home.
During the course of the search, gardai found a small amount of cannabis herb, valued at €75, as well as 11 cannabis plants.
The court heard each plant had an estimated street value of €800, making the total value of the cannabis €8,875.
Horton further admitted to driving without insurance at Citywest Business Park on September 15, 2015.
The court heard that the defendant had 36 previous convictions, including three for uninsured driving.
Defence solicitor Eddie O'Connor said that the defendant made full admissions in relation to the cannabis plants when interviewed by gardai.
Mr O'Connor said the defendant was cultivating the cannabis for his own use, as he suffers from depression and anxiety.
Mr O'Connor said Horton has since attended his GP and is now on prescribed medication to cope with his depression.
In relation to the uninsured driving, Mr O'Connor said Horton no longer has a car and accepts he shouldn't have been driving. Mr O'Connor asked the judge not to send Horton to jail.
Imposing a five-month sentence and disqualifying Horton from driving for seven years, Judge Lindsay said he had no choice but to send him to jail.