Ulysses contains many references to "barracks," beginning with Buck Mulligan's joke about his soap suds on the first page. As the capital of a subjugated nation with a long history of rebellion, Dublin in 1904 was quite literally ringed with military barracks.
It is not clear why, in any realistic sense, Mulligan should bark the command, "Back to barracks!" Gifford suggests that the soap suds are somehow similar to soldiers who, having performed their morning parade, can be dismissed from formation. But these soap suds have not yet performed either of the tasks for which they have been assembled: becoming transformed into the blood of Christ, and shaving Mulligan’s face. In any case, the question of confining soldiers to their barracks, or not, would have been much on Dubliners' minds at this time, when troops were free to roam the streets at night, seeking sex and getting involved in brawls.
British soldiers were a fixture on Dublin’s streets, and the city was encircled by barracks housing large numbers of troops. Joyce makes repeated mention of the sprawling "Portobello barracks" in the south central suburb of Rathmines, the home of the two soldiers who assault Stephen in Circe. It accommodated large cavalry units. Cyclops mentions the more centrally located "Linenhall barracks," a three-acre complex of buildings erected in the 1720s and enlarged in the 1780s to promote the manufacture and trade of Irish linen. By 1904 that enterprise had been moribund for a century, and the buildings were sometimes used as barracks for British troops.
In Hades Bloom thinks how Rudy must have been conceived "that morning in Raymond terrace she was at the window watching the two dogs at it by the wall of the cease to do evil. And the sergeant grinning up." "Cease to do evil; learn to do well" was the motto over the door of the Richmond Bridewell, a jail on the South Circular Road that in the 1880s and 90s was given to the War Department and expanded into the Wellington Barracks. These barracks, since 1922 called the Griffith Barracks and devoted to other uses, lie across the South Circular Road from Raymond Terrace.
There were many other such facilities. The Royal Barracks on Benburb Street, on the north bank of the Liffey west of the Four Courts, were the largest in the city. By 1735 they could house five battalions (about 5,000 soldiers), and even more capacity was added as time went on. The Richmond Barracks in Inchicore, on the western edge of the city, could house 1,600 men. The Beggars Bush Barracks were located on the southeastern edge of the city, the Aldborough House Barracks on the northeast. The Marlborough Barracks were in Glasnevin, on the northwest edge of the city.
In addition to all these British soldiers, Dubliners enjoyed the constant presence of the Royal Irish Constabulary, which was run along military lines and had a large barracks near the Marlborough Barracks. The constables of the RIC wore military-style uniforms. They were run from Dublin Castle, the center of imperial power in the city, and they had a large depot and magazine in Phoenix Park, not far from the barracks.
More army barracks were scattered throughout the country, many of them within easy reach of Dublin. Along the Military Road, which was built through the Wicklow Mountains in the years after the 1798 Rising in order to deny insurgents hiding places in the hills, five large barracks were constructed during the course of the 19th century. Athlone, in the western part of County Westmeath about 75 miles from the capital, had another large garrison.