Encore is a backend framework with built-in infrastructure. NestJS structures your code with modules and dependency injection, and leaves infrastructure to you. Encore works with any framework, and your Nest modules and providers can run inside it with infrastructure from code in your own cloud on AWS or GCP, plus local infrastructure and tracing.
Updated November 5, 2026
“What used to take days or weeks of back-and-forth between developers and infra teams is now automated and completed in minutes.”
NestJS plus Terraform and Docker, next to Encore.
| What it is | Backend framework with built-in infrastructure | Structured Node.js framework with DI |
| Existing Nest code | Modules and providers run inside Encore | Native |
| API layer | api() endpoints validated from TypeScript types | Controllers, decorators, pipes |
| Infrastructure | Infrastructure from code in your own cloud | Terraform, Docker and CI you write |
| Resources | Postgres, Pub/Sub, cron, buckets, cache, secrets | Modules plus services you provision |
| Local development | encore run starts local infra | Docker Compose you maintain |
| Tracing | Built in, locally and in the cloud | Add OpenTelemetry yourself |
| Service calls | Type-safe function calls | Transporters and message patterns |
| Ecosystem | Smaller, and npm packages such as Nest still work | Large module ecosystem |
NestJS gives your code structure and leaves the database, queues, environments, CI pipelines and tracing around it for you to build. Encore sets those up from your application code, in your own AWS or GCP account.
Install the CLI and add Encore to your Nest project as the guide describes. Start Nest as a standalone application context instead of an HTTP server, then turn each controller into an Encore endpoint that calls the same Nest service. Your modules, providers and dependency injection do not change.
Tested with encore.dev 1.58.8, @nestjs/core 12.3.3 and TypeScript 5.9.3.
brew install encoredev/tap/encore && encore app createimport "reflect-metadata";
import { Injectable, Module } from "@nestjs/common";
import { NestFactory } from "@nestjs/core";
import { api } from "encore.dev/api";
interface Cat {
id: number;
name: string;
}
@Injectable()
export class CatsService {
async findAll(): Promise<Cat[]> {
return [{ id: 1, name: "Pixel" }];
}
}
@Module({ providers: [CatsService] })
export class CatsModule {}
@Module({ imports: [CatsModule] })
export class AppModule {}
// Run Nest as a standalone application context instead of an HTTP server.
const applicationContext = NestFactory.createApplicationContext(AppModule).then((app) => ({
catsService: app.select(CatsModule).get(CatsService, { strict: true }),
}));
// The Nest controller becomes an Encore API endpoint.
export const findAll = api(
{ expose: true, method: "GET", path: "/cats" },
async (): Promise<{ cats: Cat[] }> => {
const { catsService } = await applicationContext;
return { cats: await catsService.findAll() };
},
);In a Nest project, a database means a TypeORM or Prisma module plus a Postgres instance you provision with Terraform. A scheduled job means @nestjs/schedule on a process you keep running. A queue means a transporter and a broker you host.
With Encore you declare a SQL database, a cron job, a Pub/Sub topic, a bucket or a secret in code. encore run starts the database and Pub/Sub locally, and on deploy Encore creates the matching resources in your AWS or GCP account, such as RDS, SQS and S3 on AWS. Secrets are set per environment with encore secret set --type prod.
See what Encore provisions →"Encore maps really cleanly to event-driven architecture. [...] Just subscribe and add a handler, let encore sort out sending those messages through SQS, retrying, and managing the DLQ."
Pick Encore when the hard part of your backend is not code structure but everything around it: databases, queues, cron jobs and several services in your own AWS or GCP account. You can keep your Nest services and dependency injection while you move over.
Pick NestJS on its own when your team relies on controllers, guards, interceptors and Nest modules such as GraphQL or WebSockets, and you already have a deploy pipeline and infrastructure you are happy with. NestJS is mature, well documented and familiar to Node.js developers.
Keep your Nest modules and providers. Run Nest as a standalone application context and replace controllers with Encore endpoints one at a time.
The guide covers adding Encore to a Nest project, running Nest standalone, defining an Encore service and replacing controllers.
Read the NestJS migration guide"Encore is our foundation for all new development. Since adopting it, we've seen a 3x increase in development speed and 90% shorter project lead times."
"Encore lets us go from idea to shipped product at least 3x faster and saves us hours of devops work every week."
"We've reduced time spent on DevOps by 95%, and we're now on track to save $60K annually in cloud costs."
"Encore is an unfair advantage. At Pave we've moved 2x faster than we did at Monzo."
"We're saving $200k+ annually compared to additional hiring. The ROI is outstanding, easily 10x."
"You define infrastructure in your code and it's automatically spun up for you. You can go from zero to a deployed service on GCP in an hour. I don't know how else to do it."
"Encore's inferred infrastructure has allowed us to move at unprecedented speed. Combined with database branching in Neon, we're able to spin ephemeral environments up and down with incredible ease. Stakeholders love preview app URLs."
Common questions about Encore vs NestJS.
Yes. Run Nest as a standalone application with NestFactory.createApplicationContext and select the services you need. Your modules, providers and dependency injection stay as they are. You replace the controllers with Encore API endpoints that call your Nest services.
Not for the resources Encore covers. Databases, Pub/Sub topics, cron jobs, object storage buckets, caches and secrets are declared in code and provisioned in your own cloud on AWS or GCP when you deploy, on Fargate ECS, EKS, Cloud Run or GKE.
They are tied to Nest controllers and are replaced along with them. Request validation comes from the TypeScript types on each Encore endpoint, and access control moves to an Encore auth handler and middleware.
Pick NestJS on its own when your team is invested in controllers, guards and the wider Nest module ecosystem, when you already run a deploy pipeline you are happy with, or when you need Nest features such as its GraphQL or WebSocket modules exactly as they work today.
Nest microservices talk through a transporter. The default TCP transporter needs no broker, while transporters such as Redis, NATS or Kafka need a broker that you provision and run. With Encore, services call each other with type-safe function calls, and Pub/Sub topics are provisioned for you in your own cloud.
Deploy to your own AWS or GCP account, with infrastructure provisioned automatically.