Pepe signed a two-and-a-half year deal with Porto, returning to the club 12 years after he first left to join Real Madrid.
The 35-year-old center back was a free agent after leaving Besiktas in December.
Pepe previously won two league titles with Porto before moving to Spain.