Officially, you can apply for a temporary or resident visa if you are still outside Peru or if you are already in the country, for example, as a tourist.
However, while for decades Peruvian consulates abroad handled temporary and resident visa applications from giving information and handing out the right forms to fill in, to accepting the application and, if approved, issuing the visa, since August 2021, Peruvian diplomatic missions abroad only handle tourist and business visa applications and refer foreigners, who want to apply for a other temporary visas or a resident visa, to Migraciones in Peru.
So, foreigners, who can enter the country visa-free (so, who don’t have to apply for a “real” tourist visa at a Peruvian consulate), should come to Peru as a tourist and then change their immigration status – make a so called Cambio de calidad migratoria (as opposed to a Solicitud de calidad migratoria if you apply from outside Peru) – at Migraciones.
Those foreigners who cannot enter Peru visa-free (so, who must apply for a “real” tourist visa at a Peruvian consulate), officially must apply for their temporay visa (except tourist and business visa) or their residency from outside Peru; a complicated, lengthy, and sometimes frustrating process. We explain in detail how it’s done in our article “Peruvian residence visa application from abroad”.