Praise be to Allah.
The basic principle with regard to exercise or sports such as running, swimming and the like is that they are permissible; however, if they are disallowed, that is because of some other matter that is connected to them but in principle has nothing to do with fasting or not fasting. But we may say:
If doing exercise or sports will lead to the fasting person becoming weak and tired, and he will not be able to pray Taraweeh, then they are makrooh because of what they lead to of missing out on one of the virtuous acts of the month of Ramadan. If they will lead to physical weakness and the need to break the fast or carelessness with regard to offering the prescribed prayers in congregation, then they are haraam.
But if they will not lead to you failing to do obligatory duties or missing out on some virtuous deeds, then they are not disallowed and they are not makrooh, either when fasting or otherwise.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked:
During the nights of Ramadan, some of the youth play sports or do exercise. What is your advice?
We think that such activities are a waste of time and cause people to miss out on highly rewarding acts of worship. This is not what the Muslim youth should be doing with their lives; what they should be doing in their lives is worshipping Allah, may He be exalted, and striving to benefit the Muslims, either by walking about in the marketplaces and speaking out against any evil they see, in a polite and gentle manner, or by gathering to read Qur’an.
As for wasting time with such matters, this leads to loss. Now in reality their society has lost these youth if they are wasting all their time in such pursuits.
If a person wants to have fun by playing permissible sports such as football (soccer), but he does that in moderation, we do not see anything wrong with that, because it is training and strengthening the body, helping the mind to relax and dispelling boredom.
End quote from Liqa’ al-Baab al-Maftooh, 116/13
There follow some words of advice concerning that:
-They should avoid playing tough sports and intense exercise during the day in Ramadan, especially in hot weather; hot weather will cause the body to lose fluids, which may lead to dehydration.
-The best time for exercising in the month of Ramadan is just before iftaar or two or three hours after iftaar; it is not recommended to exercise immediately after iftaar because all the body’s energy at that time is focused on digestion.
-It is better to play sports or exercise in places that are well ventilated, away from pollution and crowded streets.
-It is better for the sports played or exercises done during the month of Ramadan to be light and not intense, such as walking or simple calisthenics.
-The level of exercise should be moderate, so that it does not take up all one’s time; rather a specific time should be set aside for exercise.
In conclusion, it should be pointed out that doing exercise or playing sport in general, and especially in Ramadan, should not distract one from what is more important than that of matters pertaining to this world or the Hereafter.
And Allah knows best.