Police raided a property in Exeter and discovered it was being used as a distribution hub for drugs in the city.
Edvin Selimaj, 23, from Albania, was arrested after large quantities of cannabis, cocaine and cash were found at the address on Blackboy Road.
He used the property as a base where he and others would collect drugs and drop off cash.
Selimaj, an illegal immigrant who had been sofa-surfing, admitted possessing cannabis and cocaine with intent to supply and acquiring criminal property. He was sentenced to three years in prison and told he would likely be deported.
He said he would be happy to return to Albania.
Police raided the property on June 30. They saw bags of white powder, cash and a dealer's list. The defendant, who had been out when police arrived, showed up and immediately fled. He was caught after a foot chase and arrested.
Cocaine with a street value of £1,120 was found, along with 814g of cannabis worth £8,160. Cash totalling £17,755 was also seized.
Felicity Payne, defending, said Selimaj was directed by others higher up the supply chain. He came to the country illegally three years ago because of limited work opportunities in his homeland and is a hard worker.
He had worked cash in hand as a builder and at car washes. He agreed to sell drugs to earn money for people he met through social media and was paid £150 a day. He had been in Exeter for three weeks.
"He wasn't living at the address," said Miss Payne. "It was a warehouse where he and others would go to collect drugs and drop off cash. He was going in to reload and drop off cash. He was told where to go and who to sell to.
"It wasn't his money. He used his cash to spend on food and general living in the country and to send back to Albania to help his family.
"He does have a work ethic, it's just unfortunate he was directed into an illegal enterprise."

Police Bust Exeter Drug Supply Warehouse