Deploying Your Next.js App

Push to GitHub

Before we deploy, let’s push our Next.js app to GitHub if you haven’t done so already. This will make deployment easier.

  • On your personal GitHub account, create a new repository called nextjs-blog.
  • The repository can be public or private. You do not need to initialize it with a README or other files.
  • If you need help setting up your repo, take a look at this guide on GitHub.

Then:

  • If you haven’t initialized the git repository locally for your Next.js app, do so now.
  • Push the Next.js app to your GitHub repository.

To push to GitHub, you can run the following commands (replace <username> with your GitHub username):

git remote add origin https://github.com/<username>/nextjs-blog.git
git push -u origin main

Once your GitHub repository is ready, continue to the next page.