encr.dev

module
v1.57.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: MPL-2.0

README

encore icon

Encore: Infrastructure orchestration from local to your cloud

License Discord Go SDK TS SDK

What is Encore?

Encore derives infrastructure from your application code and manages it across local and cloud environments.

Build a backend that runs the same way on your laptop and in production: type-safe, traceable, and deployable to your own AWS or GCP account without Terraform or YAML.

You declare resources semantically in code, like “I need a Postgres database.” Encore turns your code into an application graph, then provisions the right infrastructure for each environment: local sandbox, managed cloud on AWS/GCP, or self-hosted Docker.

Because infrastructure is derived from the code that uses it, it stays in sync as your application evolves.

Example: Declaring resources

import { SQLDatabase } from "encore.dev/storage/sqldb";
import { Topic } from "encore.dev/pubsub";
import { Bucket } from "encore.dev/storage/objects";

// Define a Postgres database
const db = new SQLDatabase("users", { migrations: "./migrations" });
// Define a Pub/Sub topic
const signups = new Topic<SignupEvent>("signups", {
  deliveryGuarantee: "at-least-once"
});
// Define an object storage bucket
const avatars = new Bucket("avatars", { versioned: true });

Each declaration becomes a node in the application graph. Encore runs the migrations and stands up local equivalents on encore run, and provisions the cloud equivalents on deploy:

Resource Local AWS GCP
SQL Database Postgres RDS Cloud SQL
Pub/Sub NSQ SNS + SQS Cloud Pub/Sub
Object Storage Local FS S3 GCS
Cache Redis ElastiCache Memorystore
Cron Manually triggered Encore Cloud Encore Cloud
Secrets Encore vault Secrets Manager Secret Manager
Compute Local Fargate / EKS Cloud Run / GKE

When you push a change that adds or modifies a resource, Encore diffs the application graph against the environment, provisions whatever is missing in your AWS or GCP account, and rolls out the new code against it.

Configuration

Encore separates application semantics from environment-specific configuration. In code, you define what resources your app needs, not how each environment should configure them. That keeps services portable across clouds, regions, accounts, scale profiles, and local development.

Encore provisions every resource with sane production defaults, then helps you manage configuration separately from your application code:

  • Encore Cloud dashboard: easy to use knobs for all common settings like process allocation, instance sizes, replicas, etc. See more in docs.
  • Your AWS or GCP console: tweak anything directly in your cloud provider console. Encore picks up the changes on the next deploy.
  • IaC: manage config for Encore-provisioned resources alongside the rest of your infrastructure via the Terraform provider.

Language SDKs

Language Docs
TypeScript encore.dev/docs/ts
Go encore.dev/docs/go
Python Coming soon

What Changes

Before Encore:

  • Configure Localstack and docker compose to run app locally while developing.
  • Write Terraform to go to prod. Open a PR. Get approval. Apply.
  • Something breaks: IAM doesn't match what the code calls, a queue name drifts, a secret is missing in prod.
  • Fix, push, wait for the next apply, find the next thing.
  • Application code and infrastructure code meet for the first time in production.

After Encore:

  • Declare the resource in code. Run locally with encore run.
  • Open a PR and get a cloud preview environment for end-to-end testing.
  • git push to deploy. Infrastructure is derived from the application code, validated at build time.
  • IAM is configured from real code paths. No missing permissions. No unnecessary access.

The fail-loop moves from "push, wait, fix" to "run locally, see it work, push." Platform teams set guardrails once. Encore enforces them on every deploy.

Adopting Encore

You don't need a rewrite, and you don't need to use Encore for every resource in your stack.

  • Use any infrastructure as normal: Encore doesn't try to own every resource. Import the AWS SDK, GCP client libraries, or any third-party API and provision the resource yourself, or wire it up alongside Encore-managed resources via the Terraform provider.
  • Migrate service-by-service: Build new services in Encore and run them next to your existing system, integrated over APIs.
  • Deploy where your stack already lives: Encore can deploy into your existing Kubernetes cluster or into your VPC in AWS or GCP.

Start with a low-risk, frequently-changed service. See the migration guide for the full playbook.

Migrating Away

Encore is designed to make leaving easy. 99% of your code is regular Go or TypeScript, so there's not much to rewrite. See the migrate-away guide for more.

Limitations

Encore integrates at the application layer, which means a few constraints to be clear about up front:

  • Language: Your services need to be written in a supported language: TypeScript (Node.js) or Go. Python is coming soon.
  • Infrastructure scope: Encore is designed to solve the 99% use case, making it easier to work with the resources you use over and over again; services, databases, Pub/Sub, object storage, caches, cron jobs, and secrets. For the remaining 1% that is specific to your domain, you can still integrate any other service as you normally would. Encore doesn't prevent it or make it harder.
  • Cloud providers: Encore Cloud's fully-automated provisioning currently supports AWS and GCP. Azure is on the roadmap. Self-hosting via encore build docker works on any provider.

How Encore Compares

Tool What it does How Encore differs
Pulumi / CDK / Terraform / SST Infrastructure-as-Code for provisioning cloud resources No separate IaC to write. Infrastructure is generated from your application code, so the same code runs locally and deploys to AWS or GCP.
Convex / Supabase / Firebase Managed backend-as-a-service platforms Runs in your own AWS or GCP account. No vendor lock-in.
Render / Fly.io / Railway / Vercel PaaS-style deployment platforms Deploys to your own cloud account, not a managed runtime.

Quick Start

encore app create     # scaffold a project
cd myapp
encore run            # run locally with provisioned infra + dev dashboard

Install Encore:

  • macOS: brew install encoredev/tap/encore
  • Linux: curl -L https://encore.dev/install.sh | bash
  • Windows: iwr https://encore.dev/install.ps1 | iex

Full walkthrough in the Quickstart guide.

AI Integration

Encore is built for AI-assisted development. Every Encore app comes with built-in CLAUDE.md and an MCP server that lets agents introspect your app and generate type-safe code that follows your patterns. See the AI integration docs for more details.

Local Dev Dashboard

The Encore CLI ships a local dashboard for inspecting services, APIs, traces, databases, Pub/Sub messages, and architecture diagrams in real time. Run encore run and it is there at localhost:9400.

https://github.com/user-attachments/assets/461b902f-8fd3-46f1-a73c-0ebbfa789ce3

Deployment Platform

Encore Cloud is the optional managed platform. It connects to your AWS or GCP account and provisions the resources your code declares in your own VPC. Other features:

  • Preview environments for each PR
  • Distributed tracing, metrics, and logs across services
  • Architecture diagrams generated from the application graph
  • Cost analytics and infrastructure approval workflows
  • Service catalog and API documentation

See pricing and learn more.

You can also skip the platform entirely. Run encore build docker to produce a standalone image you supply an infra config to.

Who's Using Encore

150+ Teams are already shipping production apps with Encore, including: Groupon, Echo.xyz (a Coinbase company), Bookshop.org, Gradient Labs, Ashby, Later.com, Pallet, Pave Bank, and Playwire. Use cases span AI, fintech, logistics, commerce, web3, and more. See case studies to learn more.

Resources

License

Encore is licensed under the Mozilla Public License 2.0.

The framework, parser, compiler, runtime, CLI, and everything needed to develop, build, and self-host an Encore application is Open Source. Encore Cloud, the optional managed deployment platform, is a commercial service.

See CONTRIBUTING.md for additional details.

Directories

Path Synopsis
cli
cmd/encore command
cmd/git-remote-encore command
Command git-remote-encore provides a gitremote helper for interacting with Encore's git hosting without SSH keys, by piggybacking on Encore's auth tokens.
Command git-remote-encore provides a gitremote helper for interacting with Encore's git hosting without SSH keys, by piggybacking on Encore's auth tokens.
daemon
Package daemon implements the Encore daemon gRPC server.
Package daemon implements the Encore daemon gRPC server.
daemon/dash
Package dash serves the Encore Developer Dashboard.
Package dash serves the Encore Developer Dashboard.
daemon/dash/dashproxy
Package dashproxy proxies requests to the dash server, caching them locally for offline access.
Package dashproxy proxies requests to the dash server, caching them locally for offline access.
daemon/internal/debugflags
Package debugflags parses the ENCOREDEBUG environment variable, a comma-separated list of key=value pairs used to toggle non-default daemon behavior.
Package debugflags parses the ENCOREDEBUG environment variable, a comma-separated list of key=value pairs used to toggle non-default daemon behavior.
daemon/internal/sym
Package sym parses symbol tables from Go binaries.
Package sym parses symbol tables from Go binaries.
daemon/run
Package run starts and tracks running Encore applications.
Package run starts and tracks running Encore applications.
daemon/secret
Package secret fetches and caches development secrets for Encore apps.
Package secret fetches and caches development secrets for Encore apps.
daemon/sqldb/external
Package external implements a cluster driver for an external cluster.
Package external implements a cluster driver for an external cluster.
internal/browser
Package browser provides utilities for interacting with users' browsers.
Package browser provides utilities for interacting with users' browsers.
internal/gosym
Package gosym implements access to the Go symbol and line number tables embedded in Go binaries generated by the gc compilers.
Package gosym implements access to the Go symbol and line number tables embedded in Go binaries generated by the gc compilers.
internal/jsonrpc2
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
internal/jsonrpc2/servertest
Package servertest provides utilities for running tests against a remote LSP server.
Package servertest provides utilities for running tests against a remote LSP server.
internal/login
Package login handles login and authentication with Encore's platform.
Package login handles login and authentication with Encore's platform.
internal/manifest
Package manifest reads and writes Encore app manifests.
Package manifest reads and writes Encore app manifests.
internal
conf
Package conf writes and reads the Encore configuration file for the user.
Package conf writes and reads the Encore configuration file for the user.
env
Package env answers where Encore tools and resources are located.
Package env answers where Encore tools and resources are located.
gocodegen
Package gocodegen contains shared code used for generating Go code by both the compilers code generator, and the CLI's client generator.
Package gocodegen contains shared code used for generating Go code by both the compilers code generator, and the CLI's client generator.
goldfish
Package goldfish provides a short-term cache of values.
Package goldfish provides a short-term cache of values.
httpcache
Package httpcache provides a http.RoundTripper implementation that works as a mostly RFC-compliant cache for http responses.
Package httpcache provides a http.RoundTripper implementation that works as a mostly RFC-compliant cache for http responses.
httpcache/diskcache
Package diskcache provides an implementation of httpcache.Cache that uses the diskv package to supplement an in-memory map with persistent storage
Package diskcache provides an implementation of httpcache.Cache that uses the diskv package to supplement an in-memory map with persistent storage
parser
pkg
ansi
Package ansi provides helper functions for writing ANSI terminal escape codes.
Package ansi provides helper functions for writing ANSI terminal escape codes.
appfile
Package appfile reads and writes encore.app files.
Package appfile reads and writes encore.app files.
clientgen
Package clientgen generates code for use with Encore apps.
Package clientgen generates code for use with Encore apps.
editors
Package editors is a Go Port of [GitHub Desktop's editor code](https://github.com/desktop/desktop/tree/development/app/src/lib/editors)
Package editors is a Go Port of [GitHub Desktop's editor code](https://github.com/desktop/desktop/tree/development/app/src/lib/editors)
eerror
Package eerror stands for Encore Error and is used to provide a little more information about the underlying error's metadata.
Package eerror stands for Encore Error and is used to provide a little more information about the underlying error's metadata.
emulators/storage/gcsemu
Package gcsemu implements a Google Cloud Storage emulator for development.
Package gcsemu implements a Google Cloud Storage emulator for development.
emulators/storage/gcsutil
Package gcsutil contains some generic utilities to support gcsemu.
Package gcsutil contains some generic utilities to support gcsemu.
fns
github
Package github provides utilities for interacting with GitHub repositories.
Package github provides utilities for interacting with GitHub repositories.
make-release command
metascrub
Package metascrub computes scrub paths for a metadata type.
Package metascrub computes scrub paths for a metadata type.
svcproxy
Package svcproxy provides an HTTP proxy which allows the daemon to serve HTTP requests on behalf of services within the app and forward then to the appropriate process.
Package svcproxy provides an HTTP proxy which allows the daemon to serve HTTP requests on behalf of services within the app and forward then to the appropriate process.
vcs
vfs
Package vfs represents a virtual filesystem
Package vfs represents a virtual filesystem
xos
Package xos provides cross-platform helper functions.
Package xos provides cross-platform helper functions.
tools
publicapigen command
v2
app
codegen/apigen/typescrub
Package typescrub computes scrub paths for schema types.
Package typescrub computes scrub paths for schema types.
compiler/build
Package build supports building and testing Encore applications with codegen and rewrite overlays.
Package build supports building and testing Encore applications with codegen and rewrite overlays.
internals/perr
Package perr provides utilities for handling parse errors.
Package perr provides utilities for handling parse errors.
internals/resourcepaths
Package resourcepaths parses API and other resource paths.
Package resourcepaths parses API and other resource paths.
internals/schema
Package schema implements parsing of Go types into Encore's schema format.
Package schema implements parsing of Go types into Encore's schema format.
internals/schema/schematest
Package schematest provides utilities for writing tests that make assertions about schema types and declarations.
Package schematest provides utilities for writing tests that make assertions about schema types and declarations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL