1826: The Last Man by Mary Shelley, available at Project Gutenberg.
From the Wikipedia plot summary:
[. . . .]
The few remaining survivors decide to abandon England in search of an easier climate. On the eve of their departure to Dover, Lionel receives a letter from Lucy Martin, who was unable to join the exiles because of her mother's illness. Lionel and Idris travel through a snowstorm to assist Lucy, but Idris, weak from years of stress and maternal fears, dies along the way. Lionel and the Countess, who had shunned Idris and her family out of resentment towards Lionel, are reconciled at Idris' tomb. Lionel recovers Lucy (whose mother has died), and the party reaches Dover en route to France.
In France, Adrian discovers that the earlier emigrants have divided into factions, amongst them a fanatical religious sect led by a false messiah who claims that his followers will be saved from disease. Adrian unites most of the factions, but this latter group declares violent opposition to Adrian. Lionel sneaks into Paris, where the cult has settled, to try to rescue Juliet. She refuses to leave because the imposter has her baby, but she helps Lionel to escape. Later, when Juliet's baby sickens, Juliet discovers that the imposter has been hiding the effects of the plague from his followers. She is killed warning the other followers, after which the imposter commits suicide, and his followers return to the main body of exiles at Versailles.
The exiles travel towards Switzerland, hoping to spend the summer in a colder climate less favourable to the plague. By the time they reach Switzerland, however, all but four (Lionel, Adrian, Clara, and Evelyn) have died. The four spend a few relatively happy seasons at Switzerland, Milan, and Como before Evelyn dies of typhus. The survivors attempt to sail across the Adriatic Sea to Greece, but a sudden storm drowns Clara and Adrian. Lionel, the last man, swims to shore. The story ends in the year 2100.
The conclusion of Mary Shelley's novel The Last Man:
Tiber, the road which is spread by nature's own hand, threading her continent, was at my feet, and many a boat was tethered to the banks. I would with a few books, provisions, and my dog, embark in one of these and float down the current of the stream into the sea; and then, keeping near land, I would coast the beauteous shores and sunny promontories of the blue Mediterranean, pass Naples, along Calabria, and would dare the twin perils of Scylla and Charybdis; then, with fearless aim, (for what had I to lose?) skim ocean's surface towards Malta and the further Cyclades. I would avoid Constantinople, the sight of whose well-known towers and inlets belonged to another state of existence from my present one; I would coast Asia Minor, and Syria, and, passing the seven-mouthed Nile, steer northward again, till losing sight of forgotten Carthage and deserted Lybia, I should reach the pillars of Hercules. And then—no matter where—the oozy caves, and soundless depths of ocean may be my dwelling, before I accomplish this long-drawn voyage, or the arrow of disease find my heart as I float singly on the weltering Mediterranean; or, in some place I touch at, I may find what I seek—a companion; or if this may not be—to endless time, decrepid and grey headed—youth already in the grave with those I love— the lone wanderer will still unfurl his sail, and clasp the tiller—and, still obeying the breezes of heaven, for ever round another and another promontory, anchoring in another and another bay, still ploughing seedless ocean, leaving behind the verdant land of native Europe, adown the tawny shore of Africa, having weathered the fierce seas of the Cape, I may moor my worn skiff in a creek, shaded by spicy groves of the odorous islands of the far Indian ocean.
These are wild dreams. Yet since, now a week ago, they came on me, as I stood on the height of St. Peter's, they have ruled my imagination. I have chosen my boat, and laid in my scant stores. I have selected a few books; the principal are Homer and Shakespeare—But the libraries of the world are thrown open to me—and in any port I can renew my stock. I form no expectation of alteration for the better; but the monotonous present is intolerable to me. Neither hope nor joy are my pilots—restless despair and fierce desire of change lead me on. I long to grapple with danger, to be excited by fear, to have some task, however slight or voluntary, for each day's fulfilment. I shall witness all the variety of appearance, that the elements can assume—I shall read fair augury in the rainbow— menace in the cloud—some lesson or record dear to my heart in everything. Thus around the shores of deserted earth, while the sun is high, and the moon waxes or wanes, angels, the spirits of the dead, and the ever-open eye of the Supreme, will behold the tiny bark, freighted with Verney—the LAST MAN.