Judge Seán Ó Donnabháin imposed the suspended sentence on 37-year-old Ian Cronin of 4 Shamrock Avenue, Shamrock Lawn, Douglas.
The judge took into consideration favourable background reports on successful efforts made by Cronin to turn his life around in the period since the offence.
Cronin signed a plea of guilty to charges of having cocaine and possessing the drug for sale or supply on April 5, 2018, at an address at Grangewood Court, Douglas.
Frank Buttimer, solicitor, indicated that Cronin was signing a plea of guilty to the charges.
Detective Garda Pat O’Sullivan said at Cork Circuit Criminal Court that the defendant made full admissions as soon as the drugs were discovered in the search.
€1,500 in cash was also seized and that was forfeited to the State at the sentencing hearing.
Drugs paraphernalia such as weighing scales and small bags were also found during the search.
Detective Garda O’Sullivan confirmed the accused had not come to the adverse attention of gardaí since this occurred.
Emmet Boyle, barrister, said Cronin had been heavily addicted to cocaine at the time but since went on a rehabilitation programme at Bruree, County Limerick.