In order to study in Sweden as a citizen of a non-EU country, you must have a residence permit.
Read more about how to apply for a permit for studies or to work as a doctoral student:
Studying and researching in Sweden
General information about studies in Sweden:
Study in Sweden