For most of the 19th century Cardiff was the main port for exporting South Wales coal.

Cardiff shipped 998,000 long tons (1,014,000 t; 1,118,000 short tons) of coal in 1859, 1.9 million long tons (1,900,000 t; 2,100,000 short tons) in 1867 and 7.7 million long tons (7,800,000 t; 8,600,000 short tons) of coal in 1889.John Crichton-Stuart, 2nd Marquess of Bute (1793–1848) had built the Cardiff Docks, which remained in the possession of his son.

Other coal mine owners had no choice but to use these docks and the Taff Vale Railway to export their product under terms dictated by Bute.

They complained about delays and congestion at the port, and said that Bute was charging extortionate fees.

A scheme to build a dock at Barry dated back as early as 1865, when John Thomas, a retired farmer of Barry island, proposed a Glamorgan Coast Railroad to link Pencoed, Llansannor, Cowbridge and Aberthaw with Barry, and a further line to Cogan, where the Penarth Dock and the Grangetown line was already under construction to Cardiff.

Thomas proposed building a dock accessed by the railway for export of coal, iron and limestone, and import of hay, grain and vegetables for the mining districts.
The idea was also attractive to railway developers of the period.
The Ogmore Valley Railway Company wanted to increase revenue by carrying coal for shipment to the docks at Cardiff and Penarth.
H. Voss, the engineer of the Ely Valley Railway Company and the Great Western Railway, also saw its commercial potential, and made a proposal to Jenner of Wenvoe Castle to build a dock at Barry, the largest in the district, which would be connected by rail to Peterston-super-Ely on the main South Wales line.

Jenner succeeded in being granted permission to extend the railway through a series of acts in 1866, including the Barry Railway Alteration Act and the Barry Railway Extension Act which authorised the building of a narrow-gauge (4 ft-8½in) line from Barry to Cogan, joining the line to Cardiff.
The third act, the 1866 Barry Harbour Act, authorised another company to build a 600-yard (550 m) quay extending from where Buttrills Brook entered the old dock near the north-west end of the present No.1 dock.
 The act granted the permission of the deepening of the Cadoxton River, which entered the sea at Cold Knap, to allow for large ships to reach the quay, and the Barry Railway Company and the Barry Harbour Company were established.
However, the plan was never realised.

Jenner made another attempt in 1868.
It failed because he did not attract support from the coal traders, who preferred to operate in Cardiff.

Jenner dropped the idea after the Bute Dock Act of 1874 allowed an additional dock at Cardiff, but the movement to build a dock at Barry continued to gain momentum, this time by the Plymouth Estate trustees, major landowners in Glamorgan who advocated the building of the railway from Barry to Cogan.
They proposed the Penarth, Sully and Cadoxton Railway Bill, which was approved by Parliament as the Penarth Extension Railway Act in 1876.
They extended the line privately, opening it on 20 February 1878.
For most of the 19th century Cardiff was the main port for exporting South Wales coal.
Cardiff shipped 998,000 long tons (1,014,000 t; 1,118,000 short tons) of coal in 1859, 1.9 million long tons (1,900,000 t; 2,100,000 short tons) in 1867 and 7.7 million long tons (7,800,000 t; 8,600,000 short tons) of coal in 1889.John Crichton-Stuart, 2nd Marquess of Bute (1793–1848) had built the Cardiff Docks, which remained in the possession of his son. 
Other coal mine owners had no choice but to use these docks and the Taff Vale Railway to export their product under terms dictated by Bute.
They complained about delays and congestion at the port, and said that Bute was charging extortionate fees.
A scheme to build a dock at Barry dated back as early as 1865, when John Thomas, a retired farmer of Barry island, proposed a Glamorgan Coast Railroad to link Pencoed, Llansannor, Cowbridge and Aberthaw with Barry, and a further line to Cogan, where the Penarth Dock and the Grangetown line was already under construction to Cardiff. 
Thomas proposed building a dock accessed by the railway for export of coal, iron and limestone, and import of hay, grain and vegetables for the mining districts. The idea was also attractive to railway developers of the period. The Ogmore Valley Railway Company wanted to increase revenue by carrying coal for shipment to the docks at Cardiff and Penarth. H. Voss, the engineer of the Ely Valley Railway Company and the Great Western Railway, also saw its commercial potential, and made a proposal to Jenner of Wenvoe Castle to build a dock at Barry, the largest in the district, which would be connected by rail to Peterston-super-Ely on the main South Wales line.
Jenner succeeded in being granted permission to extend the railway through a series of acts in 1866, including the Barry Railway Alteration Act and the Barry Railway Extension Act which authorised the building of a narrow-gauge (4 ft-8½in) line from Barry to Cogan, joining the line to Cardiff. The third act, the 1866 Barry Harbour Act, authorised another company to build a 600-yard (550 m) quay extending from where Buttrills Brook entered the old dock near the north-west end of the present No.1 dock.  The act granted the permission of the deepening of the Cadoxton River, which entered the sea at Cold Knap, to allow for large ships to reach the quay, and the Barry Railway Company and the Barry Harbour Company were established. However, the plan was never realised. 
Jenner made another attempt in 1868. It failed because he did not attract support from the coal traders, who preferred to operate in Cardiff.
Jenner dropped the idea after the Bute Dock Act of 1874 allowed an additional dock at Cardiff, but the movement to build a dock at Barry continued to gain momentum, this time by the Plymouth Estate trustees, major landowners in Glamorgan who advocated the building of the railway from Barry to Cogan. They proposed the Penarth, Sully and Cadoxton Railway Bill, which was approved by Parliament as the Penarth Extension Railway Act in 1876. They extended the line privately, opening it on 20 February 1878.
Barry Docks