Since Next.js was created by the team at Vercel, the easiest and most reliable way to deploy is to use vercel.com (opens in a new tab).
To be able to deploy your project on Vercel you have to push your project to a git repository. We recommend using Github (opens in a new tab), but you can use any other git repository.
You first have to add the url of your new repository as an origin and then you can push your project to it.
git remote rename origin supastarter-origin
git remote add origin <YOUR_GIT_URL>
git push -u origin main
To host your project on Vercel you first have to create an account (opens in a new tab).
After signing up you will be promted to import a git repository. Select the git provider of your project and connect your git account with Vercel.
Now you will see a list of all your projects. Select the project you want to deploy and click on the Import button.
In the Configure Project view expand the Enviornment Variables section and add the following variables one by one (you can copy them from the .env file in your projects root too):
The NEXT_PUBLIC_SITE_URL is the main url of your site, e.g.
Then click the Deploy button and your project will be deployed.
Once the project was deployed you will need to add the domain to your supabase auth settings, to enable the redirects.
You can find the domain on the Overview page of your Vercel project under Domains.
Now head to supabase and navigate to Authentication > URL Configuration and add the following redirect URL to the Redirect URLs:
** is wildcard that enables all redirect urls for the domain.