An early-morning fire displaced 23 residents of a Cary apartment complex from their homes early Wednesday.