O'Keefe was elected to municipal politics in 1997 as a councillor at large and was re-elected to the position in the 2001 municipal election. In 2005 he was elected deputy mayor of the city and held that position till the resignation of mayor Andy Wells in 2008.
Mayor
Following Wells' resignation O'Keefe served as acting mayor from March to April 2008, before resigning to run in a June by-election to replace Wells. His only opponent for the position of mayor was Marie White, also a former deputy mayor. Both he and White campaigned on similar platforms during the by-election, which focused on environmental, financial management and planning issues. While White wanted to lobby the provincial government to amalgamate neighbouring communities with the city, O'Keefe did not want to push the issue and emphasized stronger ties with neighbouring municipalities. Referring to amalgamation of the region he stated that "It will occur when people of the communities want to amalgamate for their common benefit, and it will occur sooner than people might expect". On the June 3, by-election O'Keefe debated White, winning 58 per cent of the popular vote. O'Keefe was challenged by his deputy mayor Ron Ellsworth and local reggae singer and organic farmer Mark Wilson in the 2009 municipal election. O'Keefe was re-elected mayor that September, winning 57 per cent of the popular vote against his two challengers. O'Keefe has been a longtime member of the Progressive Conservative Party of Newfoundland and Labrador but has been critical of the federal Conservative government of Stephen Harper. After no Conservative candidates were elected in the 2008 federal election from Newfoundland and Labrador, O'Keefe requested that Harper appoint an un-elected Senator from the province into his cabinet. However, Nova ScotiaMember of ParliamentPeter McKay became Newfoundland and Labrador's de facto minister in the federal cabinet. Several months later O'Keefe called for the provinces MPs to vote against Harper's minority government's 2009 budget, which provincial politicians said attacked Newfoundland and Labrador. in 2012, O'Keefe criticized the federal budget for the public service jobs that were cut in the city and later said he was looking forward to the day that Harper would not be prime minister. His comments were attacked by Labrador Conservative MPPeter Penashue, who said that O'Keefe was fear mongering and that his comments were reckless. O'Keefe underwent heart surgery in April 2011, to clear three blockages in a single artery. O'Keefe had collapsed following a routine stress test, and was revived by CPR and a defibrillator, days earlier. His surgery was successful and he returned to work later that spring. O'Keefe was re-elected in the 2013 municipal election, defeating Sheilagh O'Leary and Geoff Chaulk. In August 2017, O'Keefe announced he would not run for re-election in the 2017 election. He was succeeded by Danny Breen.