If you are travelling to Rome from Civitavecchia on the train then buy your tickets from the station and not from the ticket agents adjacent to the dock as they charge double for a single ticket. Give yourself plenty of time because it is really busy at the station.
There is a ticket machine at the entrance to the station on your return. The machine takes notes and will give change.
The trains are very crowded and we had to stand all the way to Rome. There is a toilet on the train.