The former Bristol City and Celtic midfielder netted twice from the spot in the first half after winger Sone Aluko had been fouled in the penalty area by first Simon Mensing and then Jack Ross.
Defender Zander Diamond added a third six minutes after the break with a clinical finish to put the result beyond doubt before Hartley sealed his hat-trick from the spot after 65 minutes following a foul by Ross on Chris Maguire.
Dons boss Mark McGhee handed competitive debuts to new skipper Hartley, defender Rory McArdle, Togolese midfielder Yoann Folly and former Cardiff City striker Josh Magennis.
Former St Mirren goalkeeper Mark Howard also started with Jamie Langfield, who had missed most of the Dons' pre-season after scalding his foot, named on the bench.
Hamilton, who won on both of their visits to the Granite City last season, also featured a few fresh faces with summer signings Jack Ross, Gavin Skelton and David Buchanan all starting.
Midfielder Gary McDonald also made his debut against his former club following his summer switch to the Accies.
Aberdeen, eager to start the season on a positive note after finishing a disappointing ninth in the SPL last term, almost broke the deadlock in spectacular fashion after seven minutes.
Aluko's curling free-kick from 30 yards was only kept out by a combination of the crossbar and Tomas Cerny, with the Czech keeper also managing to prevent Magennis turning home the rebound.
But the Dons did open the scoring after 18 minutes when Hartley coolly converted from the spot after Aluko had been bundled over in the box by Mensing.
McArdle received the first booking of the match from referee Dougie McDonald for a late challenge on Marco Paixao after 29 minutes before Aluko's low drive from distance was well gathered by Cerny.
The Dons were awarded a second penalty five minutes before the break when Aluko was again felled in the box, this time by a tug from debutant Ross.
Hartley again stepped up and sent Cerny the wrong way to double the home side's lead to the delight of the vocal home support.
Hamilton withdrew Kyle Wilkie for French striker Joel Thomas before the break as a frustrated Billy Reid searched for a way back into the game.
Things got even better for McGhee's men six minutes into the second half when Diamond managed to volley the ball past Cerny following a goalmouth scramble sparked by a Hartley corner, with Folly and Magennis both having shots blocked in the build-up to the goal.
Buchanan, who had endured a torrid first start for the Accies, was replaced by Jordan Kirkpatrick after 55 minutes with Aberdeen's Peter Pawlett making way for Fraser Fyvie.
Hartley was given the rare opportunity to score a hat-trick of penalties after 65 minutes when Maguire was brought down in the box by Ross and the Scotland international made no mistake once again to put the Dons further ahead.
The midfielder was given a standing ovation when he was replaced by Derek Young a minute later.
Aberdeen were inches away from goal number five when Andrew Considine crossed for Magennis, whose header struck the crossbar.
Hamilton never looked like threatening in the closing stages as the Dons held out for an emphatic opening-day victory.