You find all information on requirements and how to apply for residence permit on the website of the Swedish Migration Agency:
If you are a refugee and are outside your country of origin, in the first instance you should register with UNHCR in the country where you are.