Was on an indonesia cruise a few months ago.
When you get on they will collect your passport and give it back when you leave indonesia. For the visa, first check what is needed and accepted. What I am describing is for the USA.
You can do nothing and you will get a visa on board, the cruise line will also charge you. For HAL the cost was $60, I don't know if that was what Indonesia charged them.
The more work version and cheaper is to go to the Indonesia on-line site https://molina.imigrasi.go.id/ and for around $35 get your visa there, the site can be a pain to get working. If you go this way make sure you print out find the final version with all the bar codes. Then include a printed copy of that visa with your passport. Tell the cruise people when they are collecting your passports and they flagged it.
I did the on-line version and was not charged the money for the visa.
Also Singapore require you to do a pre-arrival approval.