“How much does it cost to run Dify on AWS?” has no single answer, because Dify on AWS is not one architecture. The same application runs on a single virtual server for the price of a streaming subscription, or as a managed, highly available platform for roughly ten times that. This article prices the three setups I actually recommend to people, side by side, so you can choose with your eyes open.
Every figure below is an estimate for the Tokyo region (ap-northeast-1) as of December 2026, based on public AWS list prices, and labelled as an estimate on purpose: prices change, discounts and free tiers vary, and your usage will differ. Verify the current numbers on the official AWS pricing pages before you budget. Model API usage is excluded from every total here — it is billed per token by Bedrock or your chosen provider, and for a busy team it will exceed the infrastructure bill. That is normal, and it is the same for all three setups.
The three setups at a glance

| 1. All-in-one EC2 | 2. Lean containers | 3. Fargate production | |
|---|---|---|---|
| Shape | One EC2 instance, Docker Compose | Small ECS Fargate tasks + Aurora Serverless v2 | ECS Fargate + Aurora + ElastiCache, Terraform-managed |
| Infrastructure estimate | USD 25–50 / month | USD 70–115 / month | USD 120–200 / month |
| Availability | Single host; downtime on failure or patching | Managed database; tasks restart automatically | Managed data tier, rolling deploys, multi-service scaling |
| Operating effort | All yours: patching, backups, upgrades | Low to moderate | Low; infrastructure as code |
| Best for | Personal use, small teams, trials | Small production services on a budget | Client-facing and team-critical deployments |
The rest of this article explains what is inside each number, what drives it up, and where the traps are. The pattern to notice: the differences are rarely the compute. They are the always-on managed services around it.
Setup 1: all-in-one EC2

One EC2 instance meeting Dify’s documented minimum (at least 2 cores and 4 GiB of RAM; 8 GiB is more comfortable) runs the entire Compose stack — application, PostgreSQL, Redis and vector store on one host and one disk. The estimated USD 25–50 per month covers the instance and its SSD storage in the Tokyo region; there is no load balancer, no NAT gateway and no managed database adding fixed charges.
This is the cheapest way to keep Dify running continuously, and the estimate is genuinely achievable — as long as you respect what the price buys. One host means one point of failure, backups and patching are your job, and scaling means a maintenance window and a bigger box. My step-by-step guide to this setup (in preparation) covers the hardening that makes it production-viable: closed security groups, HTTPS, replaced default secrets and tested backups.
Setup 2: lean containers

The middle option keeps the application in containers and moves only the database to a managed service. Dify’s services run as small ECS Fargate tasks at modest CPU and memory settings, and Aurora PostgreSQL Serverless v2 holds the data; Redis and the vector store stay as containers, and the design deliberately omits the NAT gateway — tasks run with public IPs in public subnets, or reach AWS services through VPC endpoints instead.
The estimated USD 70–115 per month breaks down roughly as: Aurora Serverless v2 at its 0.5 ACU minimum, an estimated USD 44–55 (Tokyo prices ACU-hours higher than US regions — USD 0.15 versus USD 0.12 per ACU-hour); the small Fargate tasks making up most of the remainder; and no NAT gateway charge, which alone saves an estimated USD 32 or more per month against the full production design. The honest trade-offs: tasks in public subnets need careful security-group discipline, some AWS services still require internet egress, and a load balancer — if you add one for HTTPS convenience — adds an estimated USD 16–25 per month and pushes you toward the top of the range.
Choose this tier when a real service depends on Dify but the budget is firm. You get a managed, backed-up database and self-healing containers, and you accept a less standard network design in exchange for deleting the fixed charges.
Setup 3: the Fargate production architecture

The third setup is the architecture from my guide to self-hosting Dify on AWS with Terraform: every Dify service as its own Fargate service, Aurora PostgreSQL Serverless v2 for data, ElastiCache for Redis, S3 for files, an Application Load Balancer in front, and secrets in Secrets Manager. Its always-on floor is an estimated USD 120–200 per month before any real traffic.
The components explain the floor: Aurora at its 0.5 ACU minimum is an estimated USD 44–55 of it, the ALB an estimated USD 16–25, one NAT gateway an estimated USD 32 plus data processing, ElastiCache’s smallest node roughly USD 12–25, and the minimum-size Fargate services (API, worker and web running continuously) the remainder. Nothing in that list is waste — each line buys backups, failover or a deploy that does not take the service down. You are paying, roughly, the price of one good team lunch per month to not be your own database administrator, patcher and backup system.
What actually drives the bill

Four fixed charges decide which tier you land in, and none of them is the Dify application itself. The NAT gateway is the classic surprise: it bills by the hour whether or not traffic flows, so a design with one per availability zone multiplies a charge most small deployments can reduce to one — or design away entirely, as the lean setup does. The load balancer is the second fixed line, justified by HTTPS termination and rolling deploys, optional only in the leanest designs.
Aurora Serverless v2’s minimum capacity is the third: at 0.5 ACU the database has an hourly floor even when idle, and Tokyo’s per-ACU-hour price is higher than US regions’. The fourth driver is not fixed at all — it is model usage. Every chat response, embedding and rerank is billed per token by your model provider, and an active team’s model bill routinely passes its infrastructure bill. Budget for the two separately, and put alarms on both.
Cost traps that surprise people

The first trap is leaving test deployments running. A forgotten Fargate stack or EC2 instance bills quietly for months; tag everything, and delete trials with the same Terraform destroy or console pass that created them. The second is data transfer and NAT data processing on a busy indexing workload — small per gigabyte, but knowledge-base ingestion is exactly the workload that moves gigabytes.
The third trap is assuming the minimum configuration stays the minimum. Aurora scales up under load and bills for the capacity used; worker tasks scale with indexing queues; storage grows with every uploaded document. The estimates here are floors for quiet deployments, and a popular deployment should expect to sit above them. Set a billing alarm at the level that would surprise you, not the level that would bankrupt you — you want the email while the number is still interesting, not catastrophic.
Which one should you choose?

Choose EC2 if the audience is you and a few teammates, downtime is an inconvenience rather than an incident, and the budget matters more than the operating time. Choose lean containers if a service depends on Dify daily, the database is the part you least want to operate yourself, and you can accept a less conventional network layout to keep fixed costs down. Choose the full Fargate architecture if clients or a whole team depend on it, if you need deploys without downtime, or if your time is worth more than the difference — which, at these numbers, it usually is.
And in all three cases, remember the excluded line: pick your model provider and estimate token usage separately. A guide to connecting Dify to Amazon Bedrock as the model provider is coming in this series (in preparation), including the region and pricing considerations on the AWS side.
Summary

Dify on AWS costs an estimated USD 25–50 per month on a single EC2 instance, USD 70–115 as lean containers with a managed database, and USD 120–200 as the full Fargate production architecture — Tokyo region, December 2026, infrastructure only, every figure an estimate to verify against current AWS pricing. The spread is not about the application; it is about how much availability, automation and operational relief you buy around it. Decide which of those you actually need, and the right tier chooses itself.
Coming next in this series (in preparation): Dify on EC2 with Docker Compose — the cheapest production-viable setup; and a guide to connecting Dify to Amazon Bedrock as your model provider.
