Gallagher is a former Naval Officer, and retired at the rank of Commander in 1999 after a distinguished career in Naval Intelligence. Following retirement he became the Technology Manager of the Dover, Sherborn, and Dover-Sherborn Regional School Districts. He joined Cape Cod Community College as the Executive Director of Information Technology in 2005.
He has a BS from Boston State College and an MS from the Defense Intelligence College. He attended the Middlebury College Mandarin Chinese Language School.