The Cobblers swooped for the 21-year-old after he left the iPro Stadium at the end of the season.
He had loan spells at Swindon and Gateshead but never made a first-team appearance for the Rams.
“I’ve joined for a new challenge, I know it’s a big club, and I want to get some games under my belt and try to further my career. I joined Derby at 15 up until now of course and left this summer,” Lelan told the club’s official site.
“I grew up following Derby, I was a season ticket holder, it’s a bit thing to leave you’re home town but I’m not scared of it. It comes with the job.”
Northampton boss Chris Wilder added:
“Josh is a right back who is mobile and athletic and he can fill in other positions as well.
“He has a good pedigree, he has had a good grounding with Derby and he has had loan spells at clubs who play a good footballing style.
“He was close to Derby’s first team, but the change of management pushed him down the pecking order and he is keen to try and push his way into first team football.
“In a way his background is similar to Lawson D’Ath, a youngster with a good grounding and a handful of games under his belt from a few loan spells, and like Lawson last year, he is joining us at a good age. He has impressed me when I have seen him and he conducts himself well.”