Grotte di Castellana from Bari without a car: Grotte Link
Short answer
Yes, you can go without a car using the Grotte Link, a combined regional train and bus service, with the bus run by Ferrovie del Sud Est. You buy a single ticket on Trenitalia, with a 3.30 € bus fare added to the train. Before choosing your cave route, pin down the last return bus.
Yes, you can reach the Grotte di Castellana from Bari without a car: the Grotte Link is a combined train and bus service between Bari Centrale and the caves, with the bus run by Ferrovie del Sud Est. One ticket, with a 3.30 € bus supplement on top of the train. The thing to check first is the time of the return bus, because it decides which cave route you can afford.
Short answer: yes, with the Grotte Link
The Grotte Link works like this: you take a regional train to Bari station and continue by bus to the caves. The ticket is a single one, and the bus fare for one trip from Bari Centrale is 3.30 €, added to the train leg you choose.
The bus ride takes 1 hour 6 minutes. By car it is 44 km and about 50 minutes, but if you don’t drive this is the simplest option. If it doesn’t suit you, the alternatives are at the end.
The times I have checked myself: the first departure from Bari Centrale is at 5:00 every day except Sunday, when the first one is at 9:25. The last return from Castellana Grotte is at 22:09, except on Sunday, when the last one is at 15:33. On a Sunday the return needs much more careful planning.
Where to catch the bus near Bari Centrale
The stop is near Bari Centrale station, in via Capruzzi, close to Largo Sorrentino.
The bus makes intermediate stops: Bari Centrale, Bari SudEst, Mungivacca, Triggiano, Capurso, Noicattaro, Rutigliano, Conversano, Castellana Grotte and finally Grotte di Castellana Grotte. Get off at the last one, the caves, not in Castellana Grotte town.

Photo: ReMagio at Italian Wikipedia · Wikimedia Commons · Public domain
How to buy the Grotte Link ticket
The train plus bus ticket is bought as a single purchase on Trenitalia’s sales channels. When you enter the journey, choose “Grotte di Castellana G.” as the destination (or as the origin, for the return). The system adds the bus to the train leg you picked: you see the train price when you select the date.
The same “Grotte di Castellana G.” ticket can also be bought together with the train from other stations: Bari SudEst, Mungivacca, Triggiano, Capurso, Noicattaro, Rutigliano, Conversano and Castellana Grotte.
Entry to the caves is separate. Online you can buy it up to the day before your visit: you can’t buy online for the same day. At the ticket office tickets are available every day, but only until the places on the tours run out. If you want to fit the bus times, buy online the day before.
At the ticket office the full price is 25 € for the complete route and 22 € for the partial one. Reduced (ages 6-14) is 22 € for the complete and 19 € for the partial. The Family ticket (2 adults and 2 children aged 6 to 14) costs 61 € and is online only; children up to 5 enter free with a document proving their age.
How to fit outward trip, visit and return together
The caves can only be visited with a guide, on two routes. The short one is about 1 km and takes about 50 minutes. The complete one is about 3 km, takes about 100 minutes and reaches the Grotta Bianca. If you have time, choose the complete one.
The right way to plan is to start from the end: look at the last useful bus back to Bari, subtract the length of the visit and a margin to get back to the stop, and you know when your tour must start. With the evening free (last departure at 22:09) the complete route is no problem. On a Sunday, with the last departure at 15:33, you need to arrive early and weigh it up carefully.
With an online ticket, be at the entrance shown on the ticket at least 15 minutes before the start of the visit. Remember the 1 hour 6 minutes on the bus too: arriving just before the start time is a pointless risk.
I recommend a safety margin: don’t plan around the last bus of the day. If you miss it, the intermediate stops are worth knowing (Castellana Grotte, Conversano, Rutigliano and the others): for other ways back check the times on the Trenitalia site, as I have no other timetables to give you here.

Photo: Alessandro e Damiano · Wikimedia Commons · CC BY 4.0
When to go and when not to
Visiting hours change during the year: before choosing your day, check the official calendar on the Orari e prezzi page of the caves’ website (grottedicastellana.it). You will also find which days are available there.
It is cool underground all year round, so bring a fleece and closed shoes, even if it is August heat outside.
If you go in a busy period, don’t count on the ticket office: tickets are available only until the tour places run out. Better to book online the day before. The worst day to improvise is the one where your margin on the return bus is thin, that is Sunday.
If the bus doesn’t fit: alternatives
If the times don’t work for you, an organised tour from Bari is the most practical route: the Grotte di Castellana are among the hardest places to reach without a car, together with Cisternino, a day around the Itria Valley and Castel del Monte. More in the guide to getting around without a car.
You can also split the plans. The caves go well with Alberobello, which is 57 km from Bari and reachable by train with Ferrovie del Sud Est from Bari Centrale: but do it on another day, because with the return bus and the guided visit the day is already full. Details in the Alberobello guide. For more ideas depending on how many days you have, see itineraries from Bari, and for everything else about the caves, the Grotte di Castellana guide.

Photo: hemul3059 · Magnific
FAQ
How much is the Grotte Link bus from Bari?
The bus costs 3.30 € one way from Bari Centrale, added to the cost of the train leg you choose. Cave entry is paid separately.
Where does the Grotte Link bus leave from in Bari?
The stop is near Bari Centrale station, in via Capruzzi, close to Largo Sorrentino.
How long does the bus to the caves take?
The bus from via Capruzzi to the caves takes 1 hour 6 minutes.
What is the last bus back from Castellana Grotte?
The last departure is at 22:09, except on Sundays, when it is at 15:33.