Docs

Example projects


Careers

Terms of use

Privacy policy

Contact us

Roadmap

Blog

Sign up

Next.js Hosting: Neither Hard Nor Expensive

Šimon 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:

  • pricing at scale,
  • having to subscribe to a paid Pro tier at $20 per person for websites used for commercial purposes or containing ads,
  • some developers or companies prefer or need to keep all their infrastructure in AWS. They do this for simplicity, to follow policies, or to use special AWS features.
Vercel prices in disguise meme

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.

Running Next.js on AWS Lambda

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.

Developer wants Next.js in Lambda

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-web
properties:
appDirectory: ./

Going Full-stack Easily

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-web
properties:
appDirectory: ./
connectTo:
- myDatabase
myDatabase:
type: relational-database
properties:
engine:
type: postgres
properties:
primaryInstance:
instanceSize: db.t4g.micro
credentials:
masterUserName: admin_user
masterUserPassword: $Secret('my-database-pass')

Get Started With Next.js on AWS

Start with Next.js on AWS today with Stacktape:




We are looking forward to seeing what you build with Stacktape, and your feedback to make it even better.

More on Launch Week #1 & how to support us:

Stay in touch

Join our monthly product updates.

input icon

Copyright © Stacktape 2024