Minister Budi Arie Setiadi told Reuters he had sent a warning letter to X related to this matter.
"We will certainly shut its services down," he said, pointing to Indonesia's electronic information and transaction (ITE) law that can carry a six-year jail sentence if someone spreads pornographic content.
His comments in an interview come after the social media platform recently updated its policies to permit consensually produced adult content.
X, owned by billionaire Elon Musk, has not responded to Indonesia's warning letter, Budi said, adding the government would send more letters before deciding on a potential closure.
X, formerly known as Twitter, did not immediately respond to a request by Reuters for comment.
Indonesians are big users of social media and X has 24.85 million users in the country, according to data gathering business Statista.