Ellis, 28, played for Tigers between 2012 and 2014 before joining Huddersfield Giants.
The former Leigh Centurions and Hull player spent the 2017 season on loan at Hull KR.
He said: “Since I’ve been away from Castleford I’ve become a bit of a fan and I’ve really enjoyed watching all of the success that has come to the club.
“I can’t wait to get started and be a part of that. My agent called me while I was on holiday and told me Castleford were interested and as soon as he said that I wanted to sign the contract to come back here.”
Tigers coach Daryl Powell said he is “delighted” to have Ellis, who played in the 2014 Challenge Cup final defeat to Leeds Rhinos at Headingley, back at the club.
“He left the club a few years ago and I wanted to retain him then,” he said.
“His game has matured significantly since his last time at Castleford and I am confident he will be outstanding for us alongside Luke Gale and give us a great combination at half-back.
“He has many attributes to his game, his passing ability and running games alongside a very long kicking ability will add to our armoury for 2018.”
The signing could pave the way for Ben Roberts to move to full-back if Zak Hardaker receives a ban following a positive drugs test.