It depends on where you’re coming from. From northern Italy or abroad, Olbia, Golfo Aranci or Porto Torres (265 km, about 3½ hours by car) is often more convenient. From central-southern Italy, Cagliari is better (60 km, one hour’s drive). Check the offers from the ferry companies!