Purpose — The Islamic banking sector in Indonesia has recovered from the COVID-19 pandemic. Despite the sector’s resilience to the crisis, Islamic banks have lower levels of profitability than their conventional counterparts. They therefore need to optimise profitability as well as implement sustainability practices due to their high reliance on income from intermediary functions and their core principle of protecting life and preventing harm. This study aims to optimise the post-pandemic profitability of Indonesian Islamic banks while seeking to align profitability with sustainable development goals (SDGs). Design/Methodology/Approach — The model is developed based on the combination of linear programming and financial analysis, with constraints considering banking regulations and practices. The model highlights financing product types, financing fields of business, and types of deposit products that contribute to higher profits and support sustainability practices. Findings — The recommended financing product types, financing fields of business, and deposit product types lead to profitability growth of up to 85 per cent, even better than the pre-pandemic performance of Islamic banking and the overall Indonesian banking industry. This research also finds that Islamic banks’ strategy for profit optimisation is consistent with the increasing support for SDGs. Originality/Value — There is a lack of literature discussing the alignment of Islamic banks’ profit optimisation with the SDGs. This study contributes to the literature by aligning the Islamic banks’ profitability strategy with sustainable financing. Research Limitations/Implications — The study is expected to promote the implementation of sustainability practices as well as increase the profitability of Islamic banks, drawing from evidence in Indonesia.