Front-End Web & Mobile

Deploy Next.js 14 SSR apps with AWS Amplify Hosting’s Amazon Linux 2023 Support

Introduction

Today, on AWS Amplify Hosting, the build image will default to Amazon Linux 2023 for newly deployed applications. Amazon Linux 2023 enables using newer versions of Node.js, Ruby, and Python to build applications on Amplify Hosting.

Amplify Hosting manages a default build image with a collection of pre-installed packages that you can use to automatically build applications. Until today, the default build image was based on Amazon Linux 2, which had some restrictions in the packages pre-installed on it. Starting today, Node.js 18 and 20 come pre-installed in the default build image, as well as Python 3.10 and 3.11. You can also use nvm and pyenv to install newer versions of those programming languages when they are released. Developers using Next.js 14 will be able to easily deploy their app, without any custom configuration to the build image.

Walkthrough

This blog post shows you how to upgrade your build image from Amazon Linux 2 to Amazon Linux 2023 if you already have applications on AWS Amplify Hosting that you’d like to upgrade to Amazon Linux 2023.

As a prerequisites, you will need an app hosted on Amplify Hosting. 

First, access your application Build settings in the side bar of the Amplify Console.

Amplify Console Screenshot

 

Then, scroll to the build image settings section, and click the Edit button:

Build Image Screenshot

This will open a modal box where you’ll be able to select the new Amazon Linux 2023 image to build your existing app with:

Select Image Screenshot

After you’ve changed the build image, click Save. Any new builds triggered in your application will use the newly selected image. If you’d like to go back to use Amazon Linux 2, you can follow the same steps mentioned above to select that image.

Conclusion

In this blog post, we showed you how to update your Amplify Hosting applications to use Amazon Linux 2023 as the build image. Any new applications that you create on Amplify Hosting will use this build image by default, you don’t need to make any changes.

Next steps, Deploy your SSR or static app built with Next.js, Nuxt, and more using Amplify Hosting, and join our Community Discord to leave any feedback or feature requests.

 

About the Author:

Matt HeadshotMatt Auerbach, Senior Product Manager, Amplify Hosting

Matt Auerbach is a NYC-based Product Manager on the AWS Amplify Team. He educates developers regarding products and offerings, and acts as the primary point of contact for assistance and feedback. Matt is a mild-mannered programmer who enjoys using technology to solve problems and making people’s lives easier. B night, however…well he does pretty much the same thing. You can find Matt on Twitter @mauerbac. He previously worked in Developer Relations at Twitch, Optimizely & Twilio.