Despite having some very beautiful coastline, Italy often comes under fire for relatively poor sailing infrastructure. Although they're improving, sailing in Italy is still seen as very much a rich man's sport in comparison to the USA/UK or even many Mediterranean countries—perhaps this is one reason why the Italians are introducing a new 'wealth tax' on boats, about which see below.
Much of the leisure sailing takes place around Sicily and Sardinia, and the islands along the west coast, but improved facilities and convenience make it perfectly possible to include Rome on a sailing itinerary; although the Tiber isn't navigable all the way to the city centre itself, there are marinas in nearby towns and good public transport links.
The marina at Ostia has also been a popular overwintering spot in the past, and home to some liveaboards, although the numbers seem to be reducing as the prices rise.
There's also a large maritime bookshop in Rome, near Piazza del Popolo.
Most berths are available in Porto Turistico di Roma at Ostia, a short train ride from the city centre.The marina has good access to the shops of Ostia (if you don't mind walking), and the town is a short and inexpensive train ride from the centre of Rome. However, the marina itself is by no means cheap.
If you can do without some of the conveniences of a large marina, there are also berths available in the early stages of the Tiber river itself, as well as a few miles up the coast in Fiumicino and Civitavecchia.
Italian boat tax
Back in 2012, Italy introduced an annual berthing boat tax, which applies to boats over 10m. (Boats under 10m don't seem to be included in the tax.)
However, following some late amendments, the tax appears to only be applied to vessels which are either registered in Italy, or being skippered by an Italian. (The suggestion being that to avoid the tax you would need to demonstrate that any Italians on board are only incidental guests, perhaps by not letting them help with the washing up.)
As with much of Italian bureaucracy, it's subject to confusion in the present and change in the future. To make sure you don't get caught out, it would be best to confirm the current situation and how it might apply to you before travelling.