Yes, NATS can run on AWS. For production JetStream workloads, the safest default is usually EC2 with block storage such as EBS. Be cautious with Fargate-style deployments and EFS-style network file systems, especially when JetStream persistence is required.
This guidance comes from a recurring NATS community question: whether NATS servers should be hosted on AWS, and which compute and storage choices make sense for production.
For NATS Core-only use cases, Fargate-style deployment can be workable if your architecture accepts ephemeral placement and you do not need durable server-side stream storage.
For JetStream, Fargate is usually not the simplest default. JetStream makes NATS stateful, so you need predictable server identity, persistent storage lifecycle, restart behavior, disk latency, and failure recovery. EC2 with EBS, or Kubernetes with StatefulSets and persistent volumes, is typically easier to reason about for durable NATS storage.
Start by separating NATS Core from JetStream. The right AWS deployment model depends heavily on whether the server is stateless or stateful.
That distinction matters because JetStream turns the server into a stateful system. Once durable data is involved, placement, disk latency, filesystem behavior, restart behavior, and failure recovery become much more important.
For NATS Core-only use cases, more ephemeral container placement can be workable if your architecture tolerates the operational tradeoffs. For JetStream, treat the NATS server like other stateful infrastructure: closer to a database or log storage system than a stateless service.
For JetStream deployments on AWS, EC2 with EBS is often the simplest model to reason about:
As a practical starting point, some production deployments use EBS provisioned around 3000 IOPS for reasonably performant environments. That number is not a universal sizing rule. JetStream performance depends on message size, publish rate, acknowledgement patterns, retention, replication, consumer behavior, filesystem, instance type, and storage configuration.
The safest approach is to benchmark your actual workload and validate end-to-end behavior under failure and recovery, not just steady-state publish throughput.
Prefer EBS-style block storage for JetStream persistence unless you have tested and accepted the tradeoffs of another storage layer.
NATS is not tightly coupled to one specific filesystem provider, but JetStream persistence is sensitive to storage behavior. For durable messaging, prefer storage with predictable latency and filesystem semantics appropriate for stateful systems.
On AWS, that usually means favoring EBS-style block storage over EFS-style network file storage for JetStream.
Network file systems can be attractive because they simplify sharing and attachment, but they are generally a poor default for databases, messaging systems, and transactional state. They may introduce latency, consistency, locking, or failure-mode behaviors that are not what you want underneath a durable messaging layer.
If you are considering EFS, NFS, or another network filesystem anyway, treat it as an explicit risk decision. Test crash recovery, leader changes, disk stalls, latency spikes, and sustained write behavior before depending on it.
Fargate-style platforms are useful for running containers without managing instances directly. That abstraction is often a good fit for stateless services. It is less natural for core stateful assets such as databases, durable message brokers, and systems with transactional storage.
For JetStream, the operational concerns include:
If the platform can move or replace tasks in ways that make state ownership harder to reason about, you may end up rebuilding many of the stateful scheduling guarantees yourself. That work can outweigh the simplicity you hoped to gain from the serverless container model.
A Fargate-style deployment may be acceptable for NATS Core-only use cases where the servers are intentionally treated as ephemeral and no JetStream data is stored locally. For JetStream, EC2 with EBS, or a Kubernetes deployment using StatefulSets and persistent volumes, is usually easier to operate predictably.
If your organization wants container orchestration for NATS, Kubernetes is often a better fit for stateful deployments than a purely ephemeral task runner.
Kubernetes StatefulSets are designed around concepts that matter for JetStream:
But Kubernetes gives you primitives that map more naturally to operating a replicated stateful service.
Use this conservative decision path for a production-oriented AWS deployment:
Yes. NATS is commonly run on AWS. The important decision is not whether NATS can run there, but whether your deployment model matches your use of NATS Core, JetStream, and persistent storage.
No single AWS pattern is required in all cases, but EC2 with EBS is a practical and well-understood baseline for JetStream because it provides block storage and familiar stateful operational controls.
No. EFS and other network file systems should not be the default choice for JetStream persistence. If you use one, treat it as an explicit risk decision and test failure and recovery behavior carefully.
It can be, if the NATS servers are treated as ephemeral and your architecture does not depend on durable server-side JetStream state. For JetStream, prefer deployment models that provide clearer stateful behavior.
Benchmark your actual workload, including message size, publish rate, acknowledgement patterns, retention policy, replication, consumer behavior, filesystem choice, instance type, storage configuration, and recovery scenarios.
NATS can run well on AWS, but JetStream should be treated as stateful infrastructure. EC2 with EBS is a practical and commonly used starting point. Fargate-style placement and network file systems can be useful in other contexts, but they are not the safest default for durable NATS storage. If you need orchestration, prefer platforms and storage models that provide clear stateful behavior.
Want help from the NATS experts? Meet with our architects to get help tailored to your use case and environment.



News and content from across the community