Granger was born in Zanesville, Ohio. He graduated from the United States Military Academy, placing 28th in the class of 1838. Granger became a first lieutenant of infantry in 1839. He served as an officer in the Seminole War, and was assistant instructor of tactics at West Point in 1843–44. During the Mexican–American War, Granger was promoted to captain on September 8, 1847. When the war ended, he was assigned to a series of posts on the Texas frontier.