Connor Eyre, 30, was arrested in September last year when police who raided his Ludlow home found drugs, cash and a mobile phone with thousands of messages arranging deals.
Officers acting on a warrant found 14.5g of cocaine in a plastic container and 9.3g of bud cannabis in a metal one. The street value of the cocaine has been estimated at £1,260 and the cannabis at £190.
Eyre was addicted to drugs himself at the time and funded his habit by dealing.
The messages on his phone relating to drug deals referred to cocaine and cannabis, and went back as far as September 2017, prosecutor Mr Ian Windridge told Shrewsbury Crown Court this week.
Mr Windridge said that Eyre has no previous convictions or cautions.
Eyre's representative, Miss Debra White, said that he has not touched drugs since the day of his arrest a year ago, and "has got on with his life and stayed out of trouble".
"People who deal drugs often do not think of the consequences at the time and this is an individual who was drug dealing while an addict himself.
"He has had to put all his focus into ensuring he does not use drugs himself."
Judge Anthony Lowe, who heard the case, compared drug addicts who also deal drugs to "taking some poison and then offering the poison to other people".
"[You know] the incredible damage and destruction that it can cause in people's lives, in their own lives, in their relationships, in work and so forth.
"I am going to give you a chance.
"I think it's extremely lenient, but nevertheless I have to deal with the defendant I have in front of me."
He handed down a suspended sentence of two years, with a two-year suspension period. It means that the defendant walked free but if he is convicted of another crime in the next two years, the suspended sentence is activated.
Eyre, of the Wildings in Ludlow, is also subject to a curfew, binding him to stay at home between 7pm and 6am.
The judge told him: "Connor, take this chance. You are unlikely, frankly, to ever get that chance again."
An order was made for the drugs and the phone to be seized and destroyed.