Jordan Hewitt was part of a county lines network supplying class A drugs in Whitchurch, 35 miles away from his home in Merseyside.
The 20-year-old, of Rankin Street, Wallasey, was arrested by police officers in June, charged and sentenced this week.
He appeared at Shrewsbury Crown Court after pleading guilty to being concerned in the supply of crack cocaine, concerned in the supply of heroin and possession of a controlled drug cannabis resin.
He also pleaded guilty to possession of a knife/pointed article in a public place, driving while disqualified and driving without insurance.
As well as his prison sentence he was disqualified from driving for three years.
Detective Sergeant Steve Miller, from West Mercia Police, said: “We are committed to tackling serious and organised crime and those who cause the most harm in our communities. This sentence acts a reminder to those undertaking criminality that we will not tolerate it.
“By working with our local communities we can work together to target county lines drug supplies to help protect people from harm.
“Anyone concerned about drug dealing in their local area can report it online at westmercia.police.uk and we will investigate.
"If you have information but don’t feel comfortable speaking to police, you can speak to the independent charity Crimestoppers online or by calling 0800 555 111."