You can go by public buses to Port of Miami. I can not give you specific details since I do not know from where you will take the bus. Google Maps will offer a great help. Please note if you take a bus you will have to walk from the bus station to the terminal which is a ~10 minutes walk. It is advised to go by car and get dropped off at the terminal.
You need to reach the terminal minimum of 2 hours in advance, as mentioned in the official site of Port of Miami. Anyway different cruise companies have different rules:
Passengers should arrive at least two hours prior to departure. Check with your cruise line for the latest embarkation/debarkation information.
Security procedures, prohibitions and documentation requirements vary by cruise line or destination. Contact your cruise line for details about the specific requirements and restrictions for your itinerary.
Regarding pre-boarding and luggage procedures, since you will pass a TSA check as mentioned in the official website then you will pass a metal detector and your luggage will pass X-ray scanners just like any airport.