Two days is plenty of time to explore the compact old town. Start early and take a walk along the city walls before it gets too hot. Spend the rest of the day wandering the marbled streets and calling into whichever church, palace or museum takes your fancy. Head to Buža for a sunset tipple before dinner.
The next day, start by taking the cable car up Mt Srđ, stopping at the top to visit the exhibition Dubrovnik During the Homeland War. Afterwards, pick up where you left off in the old town. When it starts to bake, wander along to Banje Beach for a dip. Spend your last evening splurging on a romantic meal at Restaurant 360°, before sampling fine Croatian wines at D'vino.
With another couple of days up your sleeve you'll have the luxury of confining your old-town explorations to the evenings, when the cruise-ship hordes have returned to their boats. On day three, plan to spend the middle of the day on the island of Lokrum. On your final day, jump on a boat to Cavtat, allowing a couple of hours to stroll around the historic town before tucking into lunch at Bugenvila.