History.com:
QUOTE

Jun 6, 1833:
President Jackson rides the Iron Horse


In Ellicott's Mills, Maryland, President Andrew Jackson boards a Baltimore & Ohio Railroad train for a pleasure trip to Baltimore. Jackson, who had never been on a train before, was the first president to take a ride on the "Iron Horse," as locomotives were known then.

SNIP

. . . By 1831, the Baltimore & Ohio Railroad had completed a line from Baltimore to Frederick, Maryland. Two years later, Andrew Jackson gave railroad travel its presidential christening.

Complete article.