There is only one way for foreigners to securely own property in Indonesia outright, instead of leasing real estate for a certain period of time: By setting up an Indonesian legal entity- a PT PMA.
The ownership title of the property is called Hak Guna Bangunan (HGB). The Right to Build and Right to Use(Hak Pakai) titles provide you with clear legal grounding.
A non-Indonesian citizen cannot own land in Indonesia. However, a foreigner can acquire a leasehold title (Hak Sewa) to land and building for a defined period of time. This title can be held in your own personal name and is 100% legal and protected by Indonesian law.