The monthly deficit was £4.14bn, up from £1.07bn in September.
Between August and October there was a deficit of £8.4bn, a £2.4bn increase from the previous quarter, the Office for National Statistics (ONS) said.
The growing deficits were due to a big increase in imports of goods, combined with a small decrease in exports.
"October's dismal UK trade figures provided further signs that the economic recovery has remained worryingly-unbalanced in the fourth quarter," said Paul Hollingsworth, UK economist at Capital Economics.
"The economic recovery looks unlikely to garner support from the external sector in Q4, and instead will remain reliant on the domestic services sector."
The monthly trade deficit figures are notoriously volatile, and the ONS lost the national statistic designation from the series following a series of errors last year.
The deficit in goods in the three months to the end of October was £31.6bn, £2.5bn wider than in the previous quarter.
That was largely due to a £1.6bn fall in fuel exports and £1.3bn rise in imports of machinery and transport equipment.
The UK's trade deficit - the difference between the amount it imports and exports - widened considerably in October, according to official figures.