<aside> 🌱 The following is a tutorial for deploying and hosting a Next.js web app on AWS, using their Elastic Beanstalk service. Elastic Beanstalk (EB) is a service used to deploy, manage, and scale web applications and services.
</aside>
npx create-next-app {YOUR_APP_NAME}
and you should be good to go!brew update
then brew install awsebcli
. Afterwards, you can check your installation by running eb --version
. If this doesn't work, or if you're using Windows or Linux, please refer to the link above.Within your project's root directory, type eb init
and hit enter. This will create a new Elastic Beanstalk application and begin the set-up process for the application.
You will then be prompted to select a region for your application. Choose the region that is closest to you. (I chose us-west-2)
Next, you will be asked to provide your IAM user credentials. Use the Access key ID and the Secret access key values that you generated. If this doesn't make sense to you, please see Task #4 of the prerequisites.
At this point, Elastic Beanstalk should automatically detect that you're using Node.js. Select the version of Node that you're using. You can determine this by running node --version
in a separate terminal.
It will then ask if you'd like to use CodeCommit (Amazon's version of GitHub). Say no (unless of course, you actually use CodeCommit).
It will then ask if you'd like to set-up SSH for your instances. If you'd like to do this for your project, enter y
. We won't need to SSH for the purposes of this tutorial, so feel free to type n
.