The overarching answer of where squash originated is at Harrow School, and there is information available that can certainly flesh out the details.
Harrow School is an independent (i.e. fee-paying) school for boys in Harrow, north-west of London, England. The School was founded in 1572 by John Lyon under a Royal Charter of Queen Elizabeth I.
It was there that rackets was played, from which squash spun off.
According to Wikipedia:
Historians generally assert that rackets began as an 18th-century pastime in London's King's Bench and Fleet debtors prisons. The prisoners modified the game of fives by using tennis rackets to speed up the action. They played against the prison wall, sometimes at a corner to add a sidewall to the game. Rackets then became popular outside the prison, played in alleys behind pubs. It spread to schools, first using school walls, and later with proper four-wall courts being specially constructed for the game.
Born out of rackets
Bishop Jenner who was there in 1834 explained that rackets was played in the a few spots - angles of the old Elizabethan school yard, and featured wire-covered windows, corbels, string-courses and other projections of the old school building. Each area differed so there wasn’t a standard rackets court.
These were seemingly quite small and so the ball may not have been too hard, but around 1850 two long courts were built and so a separate hard-ball rackets game developed. M.C. Kemp, an Old Harrovian of the time, reported that eleven of the boarding houses in the school had miniature rackets courts, and so used a softer ‘India Rubber’ ball. The courts provided an ideal practice opportunity for boys who would progress to rackets.
In his book Squash, a History of the Game, James Zug provides a comprehensive history of how squash emerged at and from Harrow School, saying of the new game played in the boarding houses, ‘This bastardised version of racquets was called “baby racquets” or “soft racquets” or “softer”. (Both spellings of rackets/racquets were used in UK until the 1920’s when rackets began to prevail).
Along the same lines, John Horry, author of The History of Squash Rackets, (who incidentally gave the new game yet another name saying, ‘For many years the game adopted almost all the rules of rackets and was in fact frequently referred to as mini-rackets), commented on the construction. ‘…. The boarding houses at the school built courts with wooden walls and floors).
The key date – 1865
According to Dale Vargas, a retired Harrow schoolmaster and author of The Time Line History of Harrow School,
‘In 1864 when the ‘new’ rackets court was built, four squash courts were built on the site of the fifth form court. Later the old Shell Court was converted into a further four courts. But there were no agreed dimensions for a squash court at this time and all the house yards are of different sizes’.
These four squash courts came on stream in January 1865 and became the first created for specifically for squash. It was then that it can be said that Harrow presided over the formal birth of the sport.
Four more courts
Later four more courts were added, but sizes were not uniform, and indeed the first four courts were found to be too small and so re-modelled into three larger ones in 1897. (It was not until 1922 that dimensions became standardised).
Writing in 1937, another Old Harrovian, R. Stewart-Brown reported,
‘When I went to Harrow in 1886 squash was played a good deal. My brothers had played it there some ten years earlier. There were perhaps six plain four-walled school courts, uncovered, but otherwise very like those of today but I think shorter; and many house courts.
The weapon was much like the modern squash racket, though not so good, and the ball used was a soft, thin rubber one, with or without a hole, and cost fourpence. Sometimes a smaller black bullet was used, but this was too fast. Owing, I suppose, to the fact that the original school yard courts had no right hand walls, service was always from the right and the server did not score, but went ‘in’ if he won the point. In some house courts service was not out of hand, the ball being bounced and then hit’.
Final endorsement of Harrow’s place in squash history may be taken from this article which appeared in the Times Newspaper in UK on 6 February 1937:
Lord Dunedin, a great authority on ball games, who went to Harrow in 1863 and won the champion racquet in 1867, makes an authoritative statement on the subject. He says that squash rackets had been played at Harrow from time immemorial in what was known as ‘The Corner’. That was the piece of the asphalted school yard which formed the corner made by the meeting of the old school side-wall with the wall separating the school yard from the church precincts.
Besides this, however, squash rackets was played against the walls of some of the boarding houses. These so-called courts were of fantastic shape and so of no real value, but it meant that many of the boys played ‘soi-disant’ squash rackets.
There were two open rackets courts, one called the Sixth Form and the other the Fifth Form, which were situated one above the other on two terraces at a lower level than the school yard.
In 1865 the closed racket court was built and was opened with an exhibition match between Billy Dyke, known in after life as Sir William Hart Dyke, the chief Conservative whip, and a professional from Torquay.
After the closed court had been built the Sixth Form open court was left as it was but the Fifth Form court was cut up and in its space were built four Eton Fives courts, copied from the well-known Eton courts, and three Rugby Fives courts.
The Eton game of fives was thus introduced to Harrow and become popular though the Harrow skill was far inferior to that of Eton, but the Rugby Fives courts did not have a single game of Rugby Fives played in them.
As soon as they were built the boys saw that they were just the things in which to play squash, and this was probably the first time that it was played in a regular court.
As with any past evolution some of the timings and detail may be a little uncertain, what is definite is that the sport of squash was born out of rackets at Harrow School on a hill in North West London during or just before the 1850s, with the first play on a purpose-built court beginning in 1865.