One hundred and eight years ago today James Joyce and Nora Barnacle went out walking together for the first time. "Bloomsday", the day on which the novel Ulysses takes place, happens also on 16 June 1904. Hidden aspects of his own life nourished the narrative for Joyce. His own mythology could thus merge with a number of other mythologies to add weight and substance to what was, on the surface and maybe buried in the depths too, an ordinary day in an ordinary place.

Nora worked in Finn's Hotel, and the walk between there and Merrion Square, where they originally arranged to meet, passed by 6 Clare Street, from where Samuel Beckett's father ran his business, and where Beckett would write some of his novel Murphy. Joyce, who would begin the stories in his book Dubliners in that year, 1904, and Nora planned to meet outside the house where Sir William Wilde had lived and where Oscar Wilde had been brought up, the site of many parties. Bram Stoker, who had known Wilde at Trinity College Dublin, had been a visitor to this house. His wife was a former girlfriend of Oscar Wilde. Thus the run-down city of Dublin could become sacred space if you cared and knew about those names. If you did not, or were in a hurry somewhere, as characters in Ulysses often are, as many people today still are, then it could be ordinary, like a street in any city.

In the autumn of 1974, I moved into a damp room at the back of the basement of one of two gaunt Victorian houses which stood on Upper Hatch Street, 10 minutes' walk away from here. They were the only houses on the street and were demolished in the early 1980s. My room was called the "garden flat" by the genteel landlady who lived upstairs and who often entertained her friends for drinks. There was a sink in the corridor in the basement and a toilet outside, but there was no bathroom. At night as I walked home from a pub or from the National Library, the street that led from Stephen's Green to Hatch Street was empty and desolate. These were the years before the National Concert Hall was constructed inside the shell of the old university building and when the Conrad Hotel had yet to be built. The university itself had moved to the suburbs, and the Harcourt Street train line, which had once run at the back of the house in Hatch Street, was also closed. It was not difficult to imagine that the city James Joyce wrote about in Dubliners was still in place, perhaps even more paralysed than he had ever imagined. The spirit of scrupulous meanness that he used in his prose was a spirit which a lone walker on those nights could sense as palpable and present.

The basement room in front of mine was inhabited by a man who went to work each morning and came in each night. The few times when I saw him on the street he appeared like a perfectly normal man in a suit. He looked as though he worked in an office, and did not seem in any way odd. But he was not normal – his electricity had been cut off and he lived by candlelight; he never once passed my door to go to the toilet in the backyard. I don't know what he did instead. Also, he never had rubbish to throw out. It is possible that he spent much of the weekend in his room in bed, but during the week he went out before nine and came back soon after midnight when the pubs shut. I sensed from his fumbling movements at night that he spent the evening drinking somewhere in the city.

That idea of shabby, solitary and secretive lives – men moving alone, their lives half fuelled by alcohol, men trapped in their work, living in a mean boarding house, or in bare rooms, men with some education but scant hope – makes its way into the core of the stories at the centre of Dubliners – "Two Gallants", "The Boarding House", "A Little Cloud", "Counterparts", "A Painful Case" and "Grace".

What is strange is that most of the pubs where the characters in Dubliners drank are in place to this day – O'Neill's in Suffolk Street, Davy Byrne's in Duke Street, the Oval in Middle Abbey Street, Mulligan's in Poolbeg Street. In the 1970s, even the Scotch House was still there. And it is clear, or reasonably clear, that the pub whose stairs Mr Kernan fell down was Kehoe's in South Anne Street, where the men's lavatory in the basement is still down a set of steep steps.

As he drew these men, offered them little comfort and tiny moments of possibility, Joyce was concerned not with some dark vision he had of mankind and our fate in the world but rather with the individual self he named and made in all its particularity and privacy. The self's deep preoccupations, the isolation of the individual consciousness, which keeps so much concealed, were what he wished to dramatise. The self ready to feel fear or remorse, contempt or disloyalty, bravery or timidity; the self in a cage of solitude or in the grip of grim lust; the self ready to notice everything except that there was no escape from the self, or indeed from the dilapidated city; these were his subjects.

In Dubliners, Joyce did not allow his stories of adult experience to be tempered with stories of childhood innocence. The early stories of childhood and youth had a more menacing edge than some of the stories of adulthood. Indeed, the child narrator of the very first story seemed in possession of a darker knowledge than anyone else in the book. In "An Encounter", the narrator, also a schoolboy, takes in the disturbed sexuality of the man he meets with a sort of openness and ease. (The story, according to Stanislaus Joyce, was based on a real encounter that the young Joyce had.) In "Araby", a young boy's obsessive love for a young girl is fully sexualised, made more real and dramatic than any other attachment in the book.

In a letter to a publisher in May 1906 Joyce set out in terms both ambitious and modest what he had in mind when he composed the stories:

"My intention was to write a chapter of the moral history of my country and I chose Dublin for the scene because that city seemed to be the centre of paralysis. I have tried to present it to the indifferent public under four of its aspects: childhood, adolescence, maturity and public life. The stories are arranged in this order. I have written it for the most part in a style of scrupulous meanness and with the conviction that he is a very bold man who dares to alter in the presentiment, still more to deform, whatever he has seen and heard."

He began the stories in Dublin in 1904, when he was 22, and finished the last one, "The Dead", in 1907 in Trieste. After many difficulties and bad luck with publishers, Dubliners was published in June 1914.

Joyce's claim to write "a chapter of the moral history of his country" was grandiose; the stories themselves evaded such easy description. In them, Joyce's Dublin is a village filled with dreamers and chancers whom he placed in a kind of cage. In "Two Gallants" and "Eveline", there is a strange, almost disturbed watchfulness as the characters dream of escape from the cage of family, or work. In "After the Race" there is an empty hysteria in Doyle's attempt to keep up with his more sophisticated foreign friends. In many of the stories, the characters are watching, watchful, uneasy. Their desires seem imposed on them, and make them almost feral in their hunting, darting, insecure gestures. Joyce did not judge them, but was utterly alert to their weaknesses and their failures and was concerned to do them justice, whatever vanity or vain hope impelled them.

The city of his fiction was the city just over a decade after the fall of Parnell. In Joyce's writing, the figure of Charles Stewart Parnell, the lost leader hounded from power, remains pure, beyond reproach or mockery. Parnell had offered not only a political hope, but also a kind of mysterious, spiritual hope, all the more so in the afterglow of his power. Thus the story "Ivy Day in the Committee Room" is an essential part of the story-sequence; it dramatises the empty shell of the society after the leader's death, the citizens confined to spouting cliché and searching for drink and mawkish companionship. The sense of banality and inconsequence in every line of dialogue and in every character suggests that the glory has departed, that the light has been turned out and the characters left groping in a strange limbo.

This limbo is haunted by the noble shadow of a lost leader, but it is also infested with a strange vision of Irish nationalism, as something which people espoused to make money or help their careers. In "Araby", as part of the shrill street scene, the street-singers sing about O'Donovan Rossa, who favoured a violent nationalism.

In "After the Race", Doyle's father began life "as an advanced nationalist", but then modified his views and made money. In "A Little Cloud", Chandler realises that "the Celtic note" could help his poetry win fame in England. (Joyce did not use such a note in his own poems, as Thomas Kettle noted in a review of his first collection: "There is no trace of the folklore, folk dialect, or even the national feeling that have coloured the work of practically every writer in contemporary Ireland.")

In "A Mother", Mrs Kearney is "determined to take advantage of her daughter's name" as the Irish Revival becomes fashionable. (The concert in this story, according to Stanislaus Joyce, was based on a real event at which Joyce sang, as did John McCormack.) In Dubliners, the effort to escape the paralysis by espousing nationalism is seen as fake and fruitless. It adds an extra tawdriness to the characters who try; they are people on the make rather than a nation in search of freedom. This is further emphasised by the large number of references to pure commerce and the use of many brand names. The characters in Dubliners are consumers before they were citizens.

In Ulysses, Joyce took the closed world of Dubliners and cracked it open. While the characters in "Grace" make the reader laugh, they do not do so intentionally. They are fools. In Ulysses, such men were given a knowing wit and a sort of sharp ease in their speech which is absent from the book of stories. In "Grace" Joyce uses an accident that actually occurred to his own father in a pub, and a genuine religious retreat that his father attended. In this story he limited his father's intelligence and wit; in Ulysses, on the other hand, he suggested that the same wit was boundless. Even the nationalists in Ulysses have wit, however limited. The streets filled with darkness in Dubliners are filled with promise in Ulysses. In the novel, the dreamers and chancers seem to thrive merely by thinking, being, singing, meeting each other. The loss of a great leader offered a sort of openness to a city in which public life had become a joke, and allowed private life, private thoughts, private encounters, and even a summer's day, to have a glow and to remain fully open to possibility. The two books, then, displayed the artist in opposite moods. Dubliners shows a city filled with the colours and shades of autumn and winter. It offers images powerful enough to be repudiated with real comic energy in Ulysses.

In "Eveline" and "Clay", Joyce created two female lives even more limited and circumscribed and two consciousnesses more delicate and innocent than those of the men around them. In "Eveline", he offered the character the hope of escape, and, by the intensity of his description of her hopes and needs, created a powerful afterlife for her in the reader's mind, an afterlife in which escape is not possible. Her life will turn on the thing which did not happen, which might have been. In "Clay", the story is replete with loss and images of further loss; the central image is of Maria blindfolded touching something – "a soft wet substance" – which carries a poetic charge that lifts the story beyond its limited occasion towards a fictional space of dark mystery and suggestion.

James Joyce and Nora Barnacle in London on the day of their wedding in 1931. Photograph: Popperfoto/Getty Images

While the characters in Dubliners have a fierce privacy, a picture slowly emerges of a more public fictional space; a society, however pale and limited and filled with absences, begins to take shape. It is too simple to use the word "colonised" to describe the denizens of Dubliners, but nonetheless, the idea that they are living in a place which does not have full political autonomy, or that the public sphere in which they suffer has been somehow damaged, has to be taken into consideration. It is there in the shadows, as it were by implication.

It is easy to imagine the final story, "The Dead", happening in a number of other cities besides Dublin, capital cities which, like Dublin, did not have a parliament and in which there was no government; cities where two languages, or two cultures, seemed to clash; cities which dreamed of sacred places in the countryside in which the soul of the citizens could be purified; cities caught between a dull, deadly provinciality and the even duller possibility of cosmopolitanism. The Dublin of "The Dead" has echoes of Barcelona or Calcutta or Edinburgh in the early years of the 20th century, places where musical life could be conducted with a peculiar intensity, and songs and singers handed a strange power.

In all four cities music moved from the world of entertainment to become or replace or suggest what was missing in the public world. Songs in these cities in these years had a mystical power, and politics too, for certain people, a mystical edge. Thus a gathering of people who knew one another because of music could take on a power beyond the mere idea of music as recreation or entertainment.

In all four societies – Ireland, Catalonia, Bengal, Scotland – two languages were in conflict, or at least there was an older shadow language against the one of substance. It is easy to imagine a Calcutta intellectual being attacked for not writing in his native language, Bengali, and being married to a woman from the countryside whom he, so urbanised and deracinated, will come to misunderstand and almost foolishly desire. And it is easy to imagine a Catalan intellectual attacked for not writing his book reviews in Catalan, or a Scottish intellectual berated for not wearing a kilt.

In all these societies, as in many others, from the 1870s onwards, there was a fetishisation, first by poets and playwrights and painters and then by intellectuals and politicians, of the countryside itself. There was a fetishisation of places outside Barcelona such as the Canigo or Montseny, of the Bengali countryside, of the Highlands of Scotland and of the Aran islands, where Miss Ivors wishes to go in "The Dead". This was the primal landscape where the idea of the nation was at its most pure and uncontaminated and uncomplex.

In "The Dead", Joyce offered us images of this world first as unsettling comedy or farce, as Miss Ivors, a friend of Kathleen Kearney's, whose mother is so greedy in "A Mother", demands that Gabriel speak Irish, his native language, that he too become involved in the invention of tradition, and travel in his native landscape. But then this conflict emerges as tragedy, mystery and pure strangeness as Gretta, Gabriel's wife, makes it clear that she belonged to that older world in a way that she will never belong to him.

Once again, the atmosphere of the story is alive in the city to this day. For many years, for example, I went to the party which a friend and her daughter gave on the south side of Dublin on the Sunday before Christmas. Each year it was attended by the same people, with the same bustle in the hallway about coats and scarves. Each year there was speculation in advance about how drunk one of the guests in particular would be on arrival, and how the party would manage if he were very drunk indeed. Each year there was food served at the same time and then the same people recited the same poems and sang the same songs, and there was always a group at the very end who waited for a few final songs, which had a special emotion attached to them, before setting out into the December night.

Gabriel emerges in "The Dead" as perhaps the most innocent character in the entire collection of stories, while also the best educated and the most self-conscious. Thinking or noticing, for him, is a kind of powerlessness. His way of condescending to his genteel aunts, to Lily, the caretaker's daughter, to Miss Ivors and to the other guests is presented as essential to his character, an aspect of his alienation. In his failure to embrace the world, he carries the reader with him in a way that only the strangely obsessed children in the first three or four stories do. He is filled with ambiguities – he is well-meaning as well as pompous, oddly kind as well as superior, nervous as well as resentful. He is proud but easily undermined and threatened. He lives in possession of a knowledge which has not helped him to live; it appears instead like the bars of a cage. The party itself, through his eyes, is a cage in which the guests are trapped.

Just as "the soft wet substance" in "Clay" carries with it a poetic charge, suggesting death and decay without naming them, so, too, in "The Dead", the mention of the singer Parkinson, the pure tenor whom aunt Kate heard when he was in his prime, but who is forgotten now, carries echoes of what is to come in the story. It emphasises the power of the past and the power of memory against the thinness of the present moment. While Gabriel remembers in the story in ways which are straightforward or are evoked to amuse, his aunt and wife remember in ways which pain them, which mystify and puzzle them. Their alertness to death gives them a significant and mysterious force in the story, while Gabriel is fixed – until the last paragraph – in one dimension only.

In "Stephen Hero", Joyce wrote about the idea of "epiphanies": "By an epiphany he meant a sudden spiritual manifestation, whether in the vulgarity of speech or of gesture or in a memorable phase of the mind itself." The genius of the stories is to move the thinness of the present moment from the merely personal into a number of other realms, and to do this slowly, subtly and suggestively, using epiphanies, so that these other realms are part of the dynamic of the story rather than something imposed on it. This means that things can be both felt with sharpness and barely noticed all at the same time.

In "The Dead", Joyce evoked the soul of one uneasy man, and by implication he drew a portrait of a society. It is important to remember, however, that the portrait of the society is merely a persistent shadow in the story, with not as much substance indeed as the shadow of Michael Furey. Politics are not the subject of the story, despite the many essays written in recent years which argue that they are. Vincent J Cheng, for example, in his essay "Empire and Patriarchy in 'The Dead'", writes that "we find in Joyce's selection of this song heard on a stairwell a set of carefully designed parallels between conqueror and conquered, between imperial oppressor and colonised victim, in which Aughrim, its Lass, Gretta and Michael Furey in the rain all merge into a composite image of the loss of the Irish soul and autonomy to the imperial masters." Or Michael Leverson in his "Living History in 'The Dead'": "No reader should doubt that in representing the wavering rhythms of an evening party, 'The Dead' is representing the political fragility of Ireland."

The story evades such single and simple-minded reading, but it is part of its power that it does not do so fully. When Douglas Hyde, the founder of the Gaelic League, wrote "we have ceased to be Irish without becoming English", Joyce was aware of this argument, even more so once he himself had left the country, and aware of what this argument might mean for the construction of a fictional character.

The story, however, has other readings to offer. For anyone who visits the house on Usher's Island on the Dublin quays where the story is set, where Joyce's own great-aunts lived with their daughter, it is easy, for example, to see that Joyce was recreating a place, an atmosphere and people he remembered and loved, whose loss he regretted. In creating Gabriel, he made a version of himself – watchful, unsure, sometimes criticised by his friends for his lack of national feeling – and also of his father, whose tones he used in Gabriel's speech. (His parents, indeed, had attended these parties and stayed at a hotel afterwards.) In creating Gretta, Joyce made a version of his own wife and then dramatised his own lifelong obsession with sexual unfaithfulness, which would emerge in letters, in his play Exiles and in his novel Ulysses. It was as important as his obsession with Ireland, or with Dublin.

In the ending of the story, as in the ending of Ulysses, he would attempt to find a totalising image that would move the narrative beyond itself, risking a great deal as it did so, to finish in a set of cadences so ambiguous and open-ended as to repudiate the hard, unsparing vision and the spare prose – what Lionel Trilling called "the passionate particularity" – of all the pages that came before. At the root of Joyce's artistry is a radical uncertainty which allows multiple meanings and implications to live within his final story but none to dominate except the idea of the many mysteries at the core of things and one modern man's silent uncertainty in the face of them.

Dubliners is reissued by Canongate this month