Simon Obetko, Dev @ Stacktape
March 13, 2024
Next.js has rapidly become the go-to framework for React developers looking to build fast, scalable applications with ease. Vercel, the makers of Next.js, has been the default choice for hosting these applications due to their unmatched simplicity and connectivity.
However, lately, some developers are exploring other options besides Vercel for hosting. The reasons for looking for Vercel alternatives differ, but common issues include:
This shift has caused other hosting solutions to emerge, some aiming to make it easy to use Next.js apps on AWS without losing speed or costing too much. Stacktape is one of these solutions. It's as easy to use as Vercel but also has the versatility and strength of AWS. In this post, we'll explore how Stacktape makes hosting Next.js on AWS both easy and cost-effective.
You can deploy Next.js applications almost anywhere if you're willing to containerize them and handle them as containers. This is also possible with Stacktape, and we have a starter project to help you get started with Next.js and containers.
In some cases, it might make more sense to use containers instead of AWS Lambda to host your Next.js app. We've prepared an entire blog post comparing these two approaches (it's not yet published on our site 😬, but you can read it here).
However, running containers can be expensive (container generates costs even when there is no traffic), especially in scenarios when your application has low traffic (small portfolio site, testing environment…).
But don’t worry. For those looking to deploy Next.js on AWS without losing the benefits of serverless architecture, Stacktape has developed a purpose-built Next.js resource tailored for this exact scenario. It allows you to use serverless technology to run your Next.js apps on AWS, mirroring the ease and scalability provided by Vercel.
Running Next.js serverless is possible thanks to the open-source adapter OpenNEXT — so shout-out to its creators and community. Stacktape uses OpenNEXT to build your Next.js app, to make it run smoothly on AWS Lambda. Then, Stacktape sets up the necessary AWS resources and deploys your app, simplifying the entire process.
Here's a simple example configuration showing how easy it is to use the nextjs-web
resource with Stacktape:
resources:myWeb:type: nextjs-webproperties:appDirectory: ./
One of the main advantages of using Stacktape for Next.js hosting is having all your resources under one roof. This simplifies the deployment process, letting you easily launch full-stack applications.
With Stacktape, it's not just about deploying a Next.js app; it's about managing all your AWS services and resources in one streamlined platform. This saves time and ensures everything works well together, giving your app best performance.
resources:myWeb:type: nextjs-webproperties:appDirectory: ./connectTo:- myDatabasemyDatabase:type: relational-databaseproperties:engine:type: postgresproperties:primaryInstance:instanceSize: db.t4g.microcredentials:masterUserName: admin_usermasterUserPassword: $Secret('my-database-pass')
Start with Next.js on AWS today with Stacktape:
nextjs-web
resource.web-service
resource.We are looking forward to seeing what you build with Stacktape, and your feedback to make it even better.
Let Stacktape transform your AWS into a developer-friendly platform.
Learn more