A young man who had nearly €2,500 of MDMA powder and ketamine at his home claimed he had intended to sell the drugs to finance the debts he racked up over his cannabis use.
Michael Meighan (24) claimed his use of cannabis escalated and he ran into money problems.
He then came into the possession of MDMA and ketamine and had intended to sell it to pay off his drug debts, a court has heard.
The defendant, of Kenure Lawns in Rush, pleaded guilty at Balbriggan District Court to being in unlawful possession of €2,360 worth of drugs on January 13, 2018.
He had no previous convictions.
Defence barrister Annette Kealy said the defendant became disillusioned after a course he started when he left school turned out "disappointing" for him.
"He left the course because he was disappointed in it and he thought he was wasting his parents' money," Ms Kealy told the court.
"He then tried to get casual jobs but became disillusioned and started to take cannabis."
She said the defendant had drugs to sell to pay off his own drug debts.
"If he could go back, he wouldn't have done it," said Ms Kealy, adding that this has had a "detrimental effect" on his family.
"He made an extraordinarily poor decision and realises the problems in the drugs trade is causing an epidemic."
Ms Kealy said the defendant has now cut down on his cannabis use and hopes to eliminate it completely from his life.
Ms Kealy said the defendant is "willing to provide urine analysis" and he is doing anything he can not to let something like this happen again.
Judge John Brennan said the country is awash with drugs and "the courts have to provide a deterrent".
"If he had previous it's custody he is facing," the judge warned, before adjourning the case for a probation report.
"I am not ruling anything out. I am actively considering custody," the judge added, adjourning the case until March for the report.