To get the proper documentation to live and/or work in Indonesia can seem impossible with all the bureaucracy and regulations involved. It is so complicated and frustrating that it has created an industry of dodgy immigration agents and corruption. There is always a way around, but if you like to follow the rules, as you of course should do, you can find more info on this site:
Living in Indonesia. Have a look at the "Practical Information" section, under "Visas and Documentation". There is something called "Retirement Visa" that may be what you are looking for.