Leith throughout the medieval and early modern periods was the port of Scotland's capital city and consequently of vital importance to the Scottish economy. Leith was the principal gateway in and out of the country. It was the main point of export for eastern Scotland's goods and manufactures, including wool, fish, glass, iron and metal wares, as well as the place where wines, timber, hemp and tar arrived from abroad. Trade increased dramatically in the later 18th century, mainly as a result of the demand created by the nascent Industrial Revolution, and in addition to the vessels devoted to trade there were many involved in the fishing and whaling industries. By 1794, it was recorded that there were 144 vessels belonging to the port of Leith, with a gross tonnage of 15, 504, and by this time it had become abundantly clear that the facilities offered by the port were utterly inadequate to handle the business passing through it.
At this date Leith had no dock at all; the harbour consisted of the narrow quayed confines of the mouth of the Water of Leith, the vessels tying up to the quays to load and unload, often three-deep on either bank with the goods passing across two strange decks to reach their destinations. In addition, the river brought silt down to the bar across the mouth of the port, so that access for any but the smallest vessels was restricted to the hours immediately on either side of high tide. As if these problems were not enough, boat-building yards occupied the upper part of the harbour, further restricting access.
In recognition of the need for the improvement of the port's maritime accommodation, locally-born civil engineer John Rennie was asked by Edinburgh's city fathers to design a new dockyard on the most advanced principles. Rennie had already become known for the construction of important canals, including the Lancaster Canal and the Kennet and Avon. His design at Leith was for what became known as the Old East and West Docks, and included the first wet docks to be built in Scotland as well as two dry docks. The work was begun in 1800 and was carried out in two phases, being completed in 1817. The result was a modern, permanently accessible dockyard with accommodation for at least 150 vessels of the size then generally employed at Leith, ie from about 100 to 200 tons. A good impression of the general scheme can be gained from this map dated 1840 (below).
Rennie had also drawn up plans to extend the docks to the west in the direction of Newhaven by land reclamation, but this idea was not realised until the far more recent development of the area at the close of the 20th century. Rennie firstly built the 10.4 m wide, 44.2m long and 7m deep entrance lock with a 4m sill depth and and the East Dock, which measured 228.6m by 91.4m. Between 1810 and 1817 the West Dock was built with the same dimensions.
The development saved Leith from extinction as a major Scottish port, and after the hiatus of the Napoleonic Wars trade continued to boom during the 19th century, so much so that further improvements at Leith followed. Both the Eastern and Western Piers were considerably extended between 1826 and 1829, and the Victoria Dock was added between 1846 and 1852. About 1850, Rennie's original wooden swing bridge at the East Dock entrance was replaced by an iron structure which can still be seen, but the Old East and West Docks were filled in during later development work.
John Rennie went on to design build the Royal Ireland Canal which linked Dublin with the Shannon, the Crinan Canal, Waterloo Bridge, London Bridge (completed after his death), Southwark Bridge and Old Vauxhall Bridge as well as the docks at Hull, Liverpool,Greenock and the East India and West India Docks in London. He was also responsible for the breakwater at Plymouth Sound, which measures over a mile in length and was built in 20m of seawater, almost certainly the most colossal civil engineering project of the Georgian period. Rennie died aged 60 in London in 1821 and was buried in St Paul's Cathedral.