I looked into it fairly extensively a few years ago.
It can be done, but its not easy (or all that safe).
Land can only be owned by Indonesian nationals. Or at least majority owned (51%). Buildings however, can be 'owned' by foreigners. You will often see 'right to occupy' properties for...