In 1775, Baldwin took part in the
Siege of Boston as an engineer and was present at the
Battle of Bunker Hill, where he helped construct American fortifications. On March 16, 1776, he was appointed assistant engineer with the rank of captain in the Continental Army.
George Washington personally recommended him in a letter to
John Hancock dated April 22, 1776. He was subsequently promoted to lieutenant colonel on April 26 and to colonel of engineers on September 3, 1776. In 1777 he worked with
Tadeusz Kościuszko under General
Arthur St. Clair on the fortifications of
Fort Ticonderoga and
Mount Independence, which together formed the main American stronghold on Lake Champlain.
West Point and later service In 1780, Baldwin was again associated with Kosciuszko and St. Clair in constructing the works at
West Point. In addition to his engineering duties, he organized several companies of artificers that were later formed into
Baldwin's Regiment of Artificers. He resigned his commission on April 26, 1782. ==Shays's Rebellion==