Fellow Townsmen, as with Hardy's other works, is set in southwest England in Dorset, which he renames Wessex after the name of the medieval kingdom that existed there before England became a unified country.
There is something inseparable between his characters and the setting because they're residents of a small town and therefore, presumably, lack the sophistication of Londoners, for instance. Yet one can't be sure how much of the quiet, reserved personalities of the characters are a function of time as well as place. Hardy, writing in 1880, tells us that the principal action of Fellow Townsmen takes place "five and thirty years ago." Therefore it's set in the past from Hardy's own perspective. It's possible that as much social and technological change had taken place between 1845 and 1880 as has occurred between the 1980's or 90's and our own time today. This gives us an idea of the extent to which Hardy is portraying a vanished world. Even the conclusion of the story is set in the past, for the "elderly" Barnet returns from his travels to his home town 21 years after the main storyline, which would then be 1866, still nearly fifteen years before Hardy's writing.
The placing of the action in the past and in a (relatively) rustic setting gives a quaintness, a remote quality, to the characters Barnet, Downe, and Lucy. Their speech and careful attitudes to each other are old-fashioned even by the standards of the time in which Hardy was writing. As is typical of Hardy, missed chances and fate control the events. One feels that in a more modern and urban setting Barnet would somehow not allow events to overtake him as he does. The fact that his wife is a sophisticate herself accounts partly for the unhappiness of his marriage. When she leaves him, after recovering from her near-drowning, he makes no attempt to legalize his separation from her through divorce—though this might have been the case anywhere at that time, when divorce was considered scandalous and immoral. The plot turns on the accident of the near-death of Barnet's wife and the actual drowning of (the first) Mrs. Downe. Thus the setting on the seacoast is important. Hardy portrays the topography of "Wessex" as connected with his characters' fates as well as their characterizations.