In a statement, Porto said Casillas will be the "liason between the players, coach and management", a role that could be extended to other functions within the club.
"I'm going to do something different from what I used to do, which was to be on the field. I will try to do my best to help my teammates," the 38-year-old told the club website.
The former Real Madrid and Spain captain underwent emergency surgery on May 1 after suffering a heart attack during training. He left the hospital five days later, admitting that his professional future was uncertain.
His agent Carlo Cutropia told sports daily O Jogo that he cannot yet resume training and will have to wait for doctors to say whether he can return within "one, two or three months".
Casillas joined Porto in 2015 and extended his contract by one year in March. Club president Jorge Pinto da Costa has said he wants Casillas to be playing for Porto at 40.
He has 167 Spain caps, winning the 2010 World Cup and two European Championships, and also played more than 700 games for Real Madrid, where he won five La Liga titles, three Champions League and a handful of other major trophies.
Since moving to Porto he also added the 2018 Portuguese league title to his heaving trophy cabinet.