Ibiza’s port receives ferries from Barcelona, Valencia and Dénia, mainly run by Baleària and Trasmediterránea, plus a short and very frequent crossing to/from Formentera (about 30 minutes). Mainland crossings take several hours; overnight routes are common in summer.
There are also inter-island connections to Mallorca, useful if you want to combine both islands in one trip without flying back through the mainland.
Book ahead in summer if you want to bring a car on the ferry — vehicle spaces on the popular July-August routes sell out weeks in advance.