Nasmyth was born in Edinburgh on 9 September 1758. He studied at the Royal High School and the Trustees’ Academy and was apprenticed to a coachbuilder. Aged sixteen, he was taken to London by portrait painter Allan Ramsay where he worked on subordinate parts of Ramsay's works. Nasmyth returned to Edinburgh in 1778, where he worked as a portrait painter. Offered a loan by Patrick Miller of Dalswinton, Nasmyth left in 1782 for Italy, where he remained two years furthering his studies. In Italy he devoted most of his attention to landscape painting, and is recorded as having copied a work by Claude.
Nasmyth returned to Scotland where for the next few years he continued his career as a portraitist. He painted some works in the style of Ramsay, but most were conversation pieces with outdoor settings. His portrait of Robert Burns, who became a close friend, is now in the Scottish National Gallery. Eventually, Nasmyth’s strong Liberal opinions offended many of his aristocratic patrons in a politically charged Edinburgh, leading to a falling off in commissions for portraits, and in 1792 he completely abandoned the genre, turning instead to landscape painting. He also began painting scenery for theatres, an activity he continued for the next thirty years, and in 1796 painted a panorama.
His landscapes are all of actual places, and architecture is usually an important element. Some works were painted to illustrate the effects that new buildings would have on an area, such as Inverary from the Sea, painted for the Duke of Argyll to show the setting a proposed lighthouse.
Nasmith had a great interest in engineering, and proposed several ideas that were later widely used, although he never patented any of them. In October 1788, when Patrick Miller sailed the world's first successful steamship, designed by William Symington, on Dalswinton Loch, Nasmyth was one of the crew.
He was employed by members of the Scottish nobility in the improvement and beautification of their estates. He designed the circular temple covering St Bernard's Well by the Water of Leith (1789), and bridges at Almondell, West Lothian, and Tongland, Kirkcudbrightshire. In 1815 he was one of those invited to submit proposals for the expansion of Edinburgh New Town.
Nasmyth set up a drawing school and "instilled a whole generation with the importance of drawing as a tool of empirical investigation"; his pupils included David Wilkie, David Roberts, Clarkson Stanfield and John Thomson of Duddingston; and it was probably from him that John James Ruskin (father of John Ruskin) learned to paint as a schoolboy in Edinburgh in the later 1790s. Another successful pupil was the painter, teacher, art dealer and connoisseur Andrew Wilson, who had his first art training under Nasmyth.
Nasmyth died at home, 47 York Place (roughly opposite the house of Sir Henry Raeburn) in Edinburgh. He was buried in St Cuthbert's Churchyard at the west end of Princes Street.
Nasmyth's six daughters all became notable artists. His daughters were Jane, Barbara, Margaret, Elizabeth, Anne and Charlotte. His eldest son, Patrick Nasmyth, studied under his father, then went to London and attracted attention as a landscapist. Another son, James Nasmyth, invented the steam hammer.