No, ferry tickets can be purchased directly from the pier ticket office until a few minutes before the departure time. It can be a problem to purchase tickets in high season at the peak times (morning to Capri and evening from Capri) because of long lines and crowded ferries.