Only recently have we been returning to train travel, and working from home has continued to a greater or lesser extent, making trains perhaps less crowded but less viable. Woking has always been seen as a 'railway town', but not in the sense of Crewe or Swindon: as described below the railway brought the cemetery, and the cemetery sold off its surplus lands to make the new town adjacent to the station. 

Plans for a railway from London to Southampton were among the earliest made for the South East, being first announced in 1831. The original plan was for the line to follow the routes of the turnpike road through Esher and Ripley – roughly the old A3, but objections by landowners, as well as the attraction of building the line through unproductive and therefore cheap land, meant that the final line of the route passed over the heathland north of Woking village.

The deep cutting through St George’s Hill at Weybridge proved an expensive obstacle, but construction started in 1834 and the line from Nine Elms (the terminal building was on the north side of the present New Covent Garden Market) to Woking Common opened on 21 May 1838. The event was marked by the customary cold collation for VIPs at the station on the common, and the first test of the line came a few weeks later with Kingston (now Surbiton) being the nearest station for the Epsom Derby when eight special trains were run and the gates at Nine Elms were broken down by the crowd and no more trains ran that day.

Drawing of Woking station, 1838

The Ascot race meeting later in the summer saw special trains to Woking, but no scenes of disorder. The normal service was initially five trains a day (four on Sundays), the journey taking an hour and the fare 5s (25p) single first-class and 3s (15p) single second class.

Two misconceptions – the station was never called 'Horsell for Woking', being called 'Woking Common' and later 'Woking Junction'; the initial length of the line of 23.5 miles does not indicate that the station was at Maybury – about 23.5 miles from Waterloo – since the London terminus was Nine Elms, a mile out from Waterloo, where the terminus was established in 1848.

Woking Station, c. 1800s

Although the line was extended to Shapley Heath (now Winchfield) in September 1838 and right through to Southampton in 1840, as it did not come to any other settlements of any size until Basingstoke, Woking remained the main railhead for Surrey south of the line for several years, and coaches ran from Woking to Guildford and beyond from the common. The station became a junction in 1845 as the line was extended to Guildford, then to Godalming and eventually to Portsmouth – although the London and South Western Railway (as the company was called from 1839) – tended to view the Portsmouth line as of secondary importance, a situation which only changed in 1937 when that line was electrified ahead of the Southampton line.

Near the site of the station the Railway Hotel, now the Sovereigns, was the first building to be erected, but for some years there was little except railway activity around the station. This changed in the late 1850s when the sales by the Necropolis Company of land surplus to their cemetery led to the development of shops and houses around the station.

Nonetheless, there were plenty of plans for other lines based on Woking; those which came about were the Brookwood Cemetery Railway (1854), the line from Brookwood to Alton (1870), spurs allowing access to the Weybridge-Staines and Aldershot-Camberley lines and the 'Bisley Bullet', serving the rifle ranges for the shooting weeks. The spur at Weybridge was in regular use pre-1939, but apart from a few years in the 1980s and currently on Sundays is used only for freight and diverted trains (though trains to Heathrow may be using this in the next few years), the spurs near Pirbright had infrequent trains which ended with the electrification of the line to Basingstoke. Lines not built were two tramway routes to Knaphill, a line from Maybury to West Drayton, a line via Kettlewell to Staines, and a line via Chobham to Bagshot and Wokingham. 

By-products of Woking's railway importance are the presence in the collections of a magnificent banner from the local branch of the National Union of Railwaymen, unfortunately too fragile to display, and the establishment of the London and South Western Railway Servants' Orphanage (later the Southern Railway Servants' Orphanage and now Woking Homes), once with its own miniature railway, at Woking Grange in Oriental Road in 1909.

South Western Railway Servants' Orphanage, 1914

The merger of the Alton, Southampton and Portsmouth lines at Woking meant that services through Woking increased to a considerable extent and the original opportunities of cheap development land, a healthy environment and a good train service encouraged commuting. Woking station was rebuilt several times, to accommodate four through tracks and two terminal platforms over the years, and the 1937 rebuild still emphasised the aspect facing south to the old catchment area of the railway rather than the new and developing town north of the tracks and as far as the canal. The now-removed canopy over Albion Square was intended to help remedy this insofar as space was available.

The lines to Alton and Portsmouth were electrified in 1937 but plans for electrification to Southampton and beyond had to wait until after WW2. Electric trains reached Bournemouth in 1967, being propelled or pulled by electro-diesel locomotives from there to Weymouth until electrification was completed in 1988 and the Wessex trains were introduced – a year which also marked the 150th anniversary of the railway coming to Woking, commemorated by a large transport display 'Woking 150' in the station goods yard.

Deregulation and privatisation at first led to some enterprising routes through Woking such as that to Carmarthen and Manchester via Salisbury and Basingstoke to Ipswich via Woking and North London, but while South West Trains (SWT), the only operating company left serving Woking, occasionally extended over the old GWR routes to the west these ventures, apart from a few trains to and from Bristol have ceased, although since 2015 some trains on the Exeter line have reversed at Yeovil Junction to serve Yeovil Pen Mill and beyond.  In 2017 the franchise passed to South Western Railway (SWR) which has plans for new rolling stock and services.

The role of Woking as a transport hub has prospered by its proximity to the M25 and Heathrow Airport, and between 1965 and 2020 a coach run from Woking station to the Airport, and from 2021 a coach has run from Guildford to Heathrow taking in Woking on its route, but a similar link to Gatwick in the 1970s was not successful. There are plans for trains to the Airport via the Weybridge spur.