Rogers, 21, has enjoyed a successful season on loan at Falkirk, keeping 14 clean sheets in 35 appearances.
The US-born Republic of Ireland U21 international spent the previous campaign loaned out to Dumbarton.
Defender Scott McKenna, 19, has also signed a two-year contract extension, having made his first-team debut for the Dons in February.
McKenna featured as a late substitute in the 4-3 win at St Johnstone, having played four games on a short-term loan at Alloa in January.
"It is great news for the club that both lads have committed their futures to Aberdeen," said manager Derek McInnes.
"The challenge for both Danny and Scott now is to establish themselves in the first team. We feel that both have the chance to do so."
Rogers, who moved to Pittodrie in 2011, was due to be out of contract at the end of this season.
Goalkeeper Danny Rogers has signed a new Aberdeen deal, keeping him at Pittodrie until the summer of 2018.