There run 3-4 trains per hour between Nice and Cannes. You pay € 6.50 per person (one way, second class) for a ride of about 40 minutes. From the train station in Cannes it's a pleasant 15 minutes walk to the center of the city. Before you leave it's good to check the train timetable
How do I get to the train station from the cruise port in Nice?
In Nice are several train station. Below some further explanations.
Gare Nice Ville train station
Most direct trains leave from the main station Nice Ville. It's located in the north of the city about 45 minutes walk from the cruise port. You can shorten the walk by first going to Place Garibaldi at about 10 minutes from the port. There you take tram N° 1 which will bring you to Nice Ville train station in a few minutes for € 1 per person (one way).
TIP: You can also make the whole journey by public bus. Bus N° 30 makes a stop near the cruise port. It takes you to Nice Ville train station in 15 minutes for € 1 per person (one way).
Gare de Riquier train station
There is also a train station close to the cruise port, but depending on the destination, there depart less direct trains. Gare de Riquier is a 10 minutes walk from the cruise port. You can also take bus N° 7 at the north of the dock on Place Ile de Beauté. The ride takes 5 minutes and costs € 1 per person (one way).