Applying online is the simplest way to get a residence permit. The Swedish Migration Agency receives an online application directly.