Open WebUI on AWS ECS and Fargate

Teams that want Open WebUI on AWS without managing servers need to know which pieces must be shared, managed and kept out of the container image. This page explains the Fargate design, its trade-offs and what to confirm before building it.

On this page

Open WebUI on AWS ECS and Fargate: when a managed container platform fits

ECS on Fargate fits a team that wants Open WebUI on AWS containers without patching or sizing servers, provided the team accepts that every replica depends on managed PostgreSQL, Redis and object storage from day one. It is a weaker fit for a single small team that only needs one instance, where a Docker Compose host or a single virtual machine is simpler to run and to explain to auditors. The design this page describes places an Application Load Balancer in front of Fargate tasks running Open WebUI, with Amazon RDS for PostgreSQL (with the pgvector extension for retrieval), ElastiCache for Redis, and Amazon S3 for uploaded files and knowledge content. A separate one-off migration task runs database schema changes so that replicas do not race each other during startup.

The reason this shape is not optional at scale is set out in the Open WebUI scaling guide. For multiple replicas, Open WebUI needs PostgreSQL instead of SQLite, Redis as a shared store for sessions, websocket connections and application state, and shared file storage so uploads and knowledge stay reachable from every replica. The same guide warns that the default ChromaDB crashes in multi-process setups, so an external vector database such as PGVector is required. Without Redis, signing out does not revoke tokens, which remain valid for 4 weeks by default. A team that plans to start with one task and add replicas later should build the three managed services now, because retrofitting shared state onto a running service is the harder change.

Use the task role for AWS API access from the container, such as reading S3 objects, and keep database and Redis credentials in AWS Secrets Manager or Systems Manager Parameter Store rather than in task definitions. Confirm in your own account the current Fargate task sizes, ALB WebSocket idle timeout settings, RDS pgvector extension version, ElastiCache engine and TLS options, and whether your organization's SCPs or VPC endpoints change the networking. Those details move with AWS releases and account policy, so treat this design as a starting point to verify, not a configuration to copy.

Options for Open WebUI on AWS ECS and Fargate and when each fits

This table compares the main AWS and Open WebUI choices for a multi-replica ECS deployment, with a single-replica alternative shown where it applies. Read each row as a decision: the option, when it fits, and what it changes in operations and cost. The main takeaway is that the scaling guide's requirements for PostgreSQL, Redis, shared file storage and an external vector database apply as soon as you run more than one replica.

DecisionOptionWhen it fitsWhat it changes in operations and cost
Compute launch typeECS on FargateTeams that want no EC2 hosts to patch or scale, and can accept per-task resource sizingCosts follow task vCPU and memory, with no host fleet to manage; confirm current Fargate pricing for your Region
Compute launch typeECS on EC2Teams that need specific instance types, GPUs or lower steady-state cost at high utilizationYou patch, scale and monitor the container hosts, and capacity planning becomes your job
DatabaseRDS PostgreSQLAny deployment with more than one replica, which the scaling guide requiresAdds a managed database bill, backups, minor and major version upgrades that you schedule, and a connection limit to plan for
DatabaseSingle SQLite fileOne replica for evaluation or a small team, only on locally attached SSD or NVMe storageFargate tasks do not offer that kind of local persistence for durable data, so a SQLite file here is not a fit for production on this architecture
Shared stateElastiCache RedisMultiple replicas, where sessions and websocket state must be sharedAdds a managed cache cost and a dependency; without it, signing out does not revoke tokens until expiry, by default after 4 weeks
Shared stateNo shared stateA single replica with a short, accepted token lifetimeLower cost and fewer moving parts, but session behavior and websocket state stay tied to one task
Uploads and knowledge filesAmazon S3Multiple replicas, so every task reads the same uploads and knowledge filesStorage is billed per GB and per request; you must confirm how your Open WebUI version stores files and set bucket access through task roles
Uploads and knowledge filesNetwork file system (EFS)Teams that want a mounted POSIX path rather than object storageShared file storage is still required for replicas, but throughput and latency for file-heavy workloads need testing before you commit
Vector storepgvector on RDSSmaller knowledge bases where one managed PostgreSQL instance can carry both relational and vector dataReuses the RDS bill, but vector search competes with chat and admin queries for the same instance, so size and monitor it together
Vector storeExternal vector databaseLarge knowledge bases or heavy retrieval load, or when the scaling guide's warning about default ChromaDB appliesAdds a separately run service, its own backups and access controls; confirm which supported store your version and workload need

How the ALB, ECS tasks, RDS, Redis and S3 parts connect for Open WebUI

The diagram starts with users reaching the Application Load Balancer, which forwards traffic to Open WebUI tasks in the ECS service. From there, each task reads and writes the RDS PostgreSQL database, uses ElastiCache Redis for shared session and websocket state, and stores uploads in S3. A separate migration task runs schema changes outside the service, and the dashed boundary marks the VPC and task roles that control what each part can reach. Check that every hand-off stays inside that boundary and that no task depends on local disk.

Request path and data paths for Open WebUI on ECS Fargate, with the migration task and trust boundary.

Which AWS components the Open WebUI stack needs and why

Open WebUI runs as a stateless-looking web app, but once it has more than one task it depends on shared state, shared files and a shared database. Each AWS component below covers one of those dependencies, and each one fails in a specific way when it is missing.

RDS PostgreSQL with pgvector

PostgreSQL replaces the default SQLite database, which the scaling guide says does not handle concurrent writes from multiple processes well. Every Fargate task must point at the same database, so users, chats, settings and permissions stay consistent across replicas. If you also use the PGVector option for retrieval, the same instance can host the vector extension, which keeps embeddings in your managed database. Confirm the RDS engine version against the PostgreSQL support table before you pick one, and confirm that pgvector is available on that version in your region.

Scaling guide

ElastiCache Redis for shared state

Redis holds sessions, websocket connection state and application state shared by replicas. The scaling guide states that without Redis, signing out does not revoke tokens, which remain valid until they expire, by default after 4 weeks. Treat that as a security gap, not a cosmetic one: a user who signs out on one task can still act through a token issued by another. Place the cluster in private subnets, enable encryption in transit and at rest, and confirm the connection settings your Open WebUI version expects.

Scaling guide

S3 for uploads and knowledge files

Each Fargate task has its own ephemeral storage, so uploads and knowledge files written to a local path disappear when a task is replaced and never reach the other replicas. The scaling guide requires shared file storage so uploads and knowledge stay reachable from every replica. Confirm whether your Open WebUI version supports S3 as a storage backend in its configuration reference, and if it does not, plan a shared file system instead. Restrict the bucket with a policy, block public access and enable versioning and default encryption.

Application Load Balancer and WebSocket traffic

The Application Load Balancer terminates HTTPS and routes requests to the Open WebUI target group. Chat streaming and real-time updates use WebSocket connections, so the listener and target group must allow upgraded connections and long idle periods, and the idle timeout must exceed the longest response you expect. Health checks should target a path the application answers without a login. Test long conversations through the load balancer before go-live, because a short idle timeout cuts streams mid-answer and looks like a model fault to users.

Task roles and least-privilege access

The task role is the IAM identity the running container uses to call AWS services such as S3. It is separate from the task execution role, which only lets ECS pull images and read secrets at startup. Grant the task role access to one bucket and its prefix, and nothing broader. Keep database credentials and the Open WebUI secret key in AWS Secrets Manager or Systems Manager Parameter Store, referenced from the task definition, not written into environment variables in the image. Ask your security team to review both roles before deployment.

Separate migration task

Database schema changes should run once, before the web service starts new tasks, not inside every replica at startup. A separate one-off ECS task, launched by your deployment pipeline, runs the migration against RDS and exits. If several replicas migrate at once, they contend for the same schema changes and can fail or leave the database half-upgraded. Check the upgrade notes for each Open WebUI release, record which migration version is live, and keep a database snapshot taken immediately before the migration task runs.

Why replicas need shared state before ECS can scale the service

Adding Fargate tasks is only safe once sessions, websocket connections, uploads and knowledge are shared across every task. Until then, a second task is a second, independent copy of the application state, and users will see that as dropped sessions, missing files and inconsistent knowledge bases. Treat the desired task count as a value you may raise only after the shared components below are in place and verified. Note that the scaling guide requires PostgreSQL rather than SQLite for multi-instance deployments, because SQLite does not handle concurrent writes from multiple processes well. On this topic, that means the RDS PostgreSQL instance must be wired in through the database URL setting before the service desired count goes above one.

The same guide warns that the default ChromaDB vector store will crash in multi-process setups, so an external vector database is required once you run several workers or replicas. On AWS, the choice is between pgvector on the RDS instance and a separate managed or self-hosted vector service. Confirm the exact vector database setting names and supported values for your Open WebUI version before you write the task definition, because these settings change between releases. The guide also covers Redis as the shared store for sessions, websocket state and application state, and S3 as the place where uploads and knowledge must live so that any task can serve them.

Redis has a security consequence that is easy to miss. Without Redis, signing out does not revoke tokens: they stay valid until they expire, and by default that is 4 weeks. With several Fargate tasks behind the load balancer, a user who signs out on one task can still be authenticated on another. Confirm the token lifetime setting in your version and decide whether 4 weeks fits your session policy before you rely on sign-out as a control. Also confirm that ElastiCache Redis is reachable from every task security group and that the Redis connection is configured in all tasks, including the migration task, so no replica runs with a private, local view of state.

Setup sequence for Open WebUI on AWS ECS and Fargate

This sequence builds the network, data, secrets and identity layers first, then runs a one-off migration task and starts the ECS service behind an Application Load Balancer only after each layer has passed a check. The result is a multi-replica Open WebUI stack that a security team can review component by component.

  1. Build the network and subnets

    Create a VPC with private subnets for ECS tasks, RDS and ElastiCache, and public subnets only for the Application Load Balancer. Confirm the security groups allow the ALB to reach the Open WebUI port, allow tasks to reach the database, cache and S3 endpoints, and allow nothing else inbound. Check that a test instance in a private subnet resolves and reaches the planned database and cache endpoints once those exist, and that no database or cache endpoint is reachable from the internet. Ask your network team to confirm the outbound path for model provider calls before this step closes.

  2. Provision RDS PostgreSQL with pgvector

    Create an RDS PostgreSQL instance in the private subnets with encryption at rest, automated backups and a parameter group you can review. Connect with psql from a bastion or session manager host, run CREATE EXTENSION vector, and confirm it appears in pg_extension. Pick the PostgreSQL major version your team supports, and check the version against the PostgreSQL versioning policy so you do not start on a release near end of support. Open WebUI requires PostgreSQL instead of SQLite for multi-instance deployments, so this step is mandatory for the replica design.

  3. Provision ElastiCache Redis

    Create an ElastiCache Redis deployment in the private subnets with in-transit encryption and an auth setting your team has approved, then record the endpoint for the configuration store. Open WebUI needs Redis as a shared store for sessions, websocket connections and application state when more than one replica runs. Without Redis, signing out does not revoke tokens, which remain valid until they expire, by default after 4 weeks. Confirm from a task-like host that the endpoint accepts a connection and that the TLS and auth settings match what the application will use.

  4. Create the S3 bucket and task access

    Create a private S3 bucket for uploads and knowledge files with public access blocked, default encryption and versioning if your data policy requires it. Scope an IAM policy to this bucket and its prefix only, and attach it to the task role, not to a shared user. Multiple replicas need shared file storage so uploads and knowledge stay reachable from every task. Confirm with a test object written and read through the task role, and confirm that the same identity cannot list other buckets.

  5. Store secrets and define task roles

    Put the database password, Redis credentials, the Open WebUI secret key and any model provider keys into AWS Secrets Manager or SSM Parameter Store, encrypted with a customer managed KMS key. Create a task execution role that can only read those secret ARNs and pull the image, and a separate task role that grants S3 and nothing else. Confirm that the execution role can retrieve each secret during a test and that the task role cannot read the secrets it does not need. Keep the secret key stable across releases, since changing it invalidates existing sessions.

  6. Run the database migration as a separate task

    Register a one-off ECS task definition that uses the same image and version as the planned service, with the same secrets and environment, and run it once before any service update. Keep migrations out of the web service startup so that replicas do not race each other on schema changes. Check the task exit code and the migration logs for errors, then query the database to confirm the expected tables exist. Record the image tag used so the service and migration match in every later release.

  7. Start the ECS service behind the load balancer

    Create an ECS cluster and a Fargate service with the pinned image tag, at least two tasks spread across availability zones, and an Application Load Balancer target group that health-checks the application path. Enable WebSocket support on the listener path and make sure idle timeouts on the load balancer match what your users expect for long responses. Confirm that the service reaches a steady state, every task reports healthy, and a browser login through the load balancer succeeds on two different tasks.

  8. Verify health checks and recovery

    Confirm the target group health check reflects real readiness, so tasks are only added after the database and Redis are reachable. Stop one task and check that ECS replaces it while sessions and uploads remain available. Confirm that logs reach CloudWatch or your log platform and that alarms exist for unhealthy targets and task restarts. The sequence is complete when a replica failure, a rolling update and a sign-out test all behave as expected in a non-production environment.

Security controls for task roles, secrets and network paths

The controls below decide who can reach the Open WebUI data, where credentials live and which network paths are open. They connect because a weak link in one, such as a task role that can read every bucket or a secret key baked into an image, exposes the others. Confirm each control against current AWS guidance and your own account setup before go-live.

Least-privilege task roles

Open WebUI runs under an ECS task role that should grant only the S3 bucket and prefix used for uploads and knowledge files, plus the specific secret ARNs it reads at startup. Avoid broad managed policies that grant full S3 or Secrets Manager access. Keep the task execution role separate, since it pulls images and fetches secrets for the container runtime. Confirm current IAM guidance for ECS task roles and scope each policy by resource ARN.

Secret key and database credentials

The Open WebUI secret key and PostgreSQL credentials must not sit in the image, in the task definition as plain environment values, or in Git. Store them in AWS Secrets Manager or SSM Parameter Store and reference them from the task definition so ECS injects them at launch. Rotating the database password then requires a new secret version and a service deployment, not an image rebuild. Confirm how your team rotates these values and which secret store your policies allow.

Private subnets for data stores

RDS PostgreSQL and ElastiCache Redis should sit in private subnets with no route to an internet gateway and no public IP address. Open WebUI replicas need both services for sessions, websocket state and application data, so their reachability is the only path that matters. Check that the database and cache subnet groups span the subnets you intend to use and that public accessibility is off. Confirm the current network requirements for each service in AWS documentation.

Load balancer to task security groups

Allow inbound traffic to the Open WebUI tasks only from the Application Load Balancer's security group on the container port, and allow inbound traffic to the load balancer only on the listener ports you publish. Give the RDS and ElastiCache security groups inbound rules that reference the task security group, not CIDR ranges. Review these rules after any change to ports or listeners. Confirm the port and reference rules against the current ECS and ELB guidance for your architecture.

Log routing and retention

Send container output to CloudWatch Logs through the awslogs driver or FireLens, with a defined retention period and an encryption key chosen by your security team. Logs can contain prompts, file names and error text, so restrict who can read the log group and avoid writing secrets into log lines. Confirm the log destination, the retention setting and any forwarding to your central SIEM with your logging standard owner.

Migration task permissions

The separate migration task that applies database changes should run with its own task definition and role, granting database access and nothing else. It should not receive S3 write access or the broad permissions the web service uses. Run it on demand or as a one-time deployment step, and log every run so schema changes stay traceable. Confirm that your deployment pipeline is the only identity allowed to launch this task.

How the design changes for evaluation, a team and a regulated deployment

A single Fargate task serving one team on one task is the lowest-risk way to learn how Open WebUI behaves in your AWS account. The design can stay close to the single-replica path, with the local database file kept on locally attached SSD or NVMe storage, which is not available on Fargate's ephemeral task storage, so a team that wants SQLite should use a dedicated instance rather than Fargate. For most teams, the practical choice is RDS PostgreSQL from the start, because it removes the storage question entirely.

  • Required: a persistent database, a persistent data path for uploads, and a secret key that stays the same across restarts.
  • Deferrable: ElastiCache Redis, because a single replica does not need shared session state, and a separate migration task, because there is no replica to coordinate.
  • Deferrable: an external vector database, provided the team does not run several workers or replicas.
  • Evidence to expect: a short written list of who uses the environment, what data goes into it, and how the team would delete it.
  • Caution: the scaling guide notes that signing out without Redis does not revoke tokens, so a team that shares a workstation should shorten the token lifetime and say so in its notes.

Before expanding past one team, confirm that the database and file storage choices still hold when a second replica is proposed.

Limits to confirm in your AWS account before you commit

Several limits on this architecture depend on versions, account settings and regional availability that change over time. Confirm each one against current vendor documentation and your own AWS account before you approve a design, since a mismatch found late costs more to fix than one found in the quote stage.

Open WebUI version and database settings

Confirm which Open WebUI release you will pin and that its database and Redis settings match a multi-replica design. The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, and Redis as shared state for sessions and websockets. Check the release notes for any change to these settings before you pin the image tag, and record the tag in your change record. Also confirm which license terms apply to that release, since releases from v0.6.6 onward fall under the Open WebUI License.

Latest release noted
v0.12.3
Scaling docs

Fargate task sizing for your user count

Fargate charges for the CPU and memory each task reserves, so task size and replica count drive most of the recurring compute cost. Size against your expected concurrent users, streaming responses and any document processing, not total headcount. Ask for a load test on a staging stack that mirrors your task definition, and confirm the memory ceiling your chosen task size allows for the Open WebUI container under peak use.

WebSocket timeouts on the load balancer

Open WebUI uses websockets for live updates and streams model output, so the Application Load Balancer idle timeout and target group settings affect long conversations. A short idle timeout can drop streams mid-answer and make users retry. Confirm the current idle timeout limits in AWS documentation, set the value deliberately, and test a long-running streamed response through the full path to the browser before go-live.

pgvector version on the RDS engine

If you use PGVector for retrieval, confirm that the RDS PostgreSQL engine version and region you select offer the pgvector extension and the version your Open WebUI release expects. Extension availability varies by engine version, so check the RDS extension list for your exact engine before you design around it. Plan the extension install as a controlled change in the migration task, not a manual step on a live database.

Open WebUI features

S3 access patterns for uploads

Uploads and knowledge files must be reachable from every replica, so S3 becomes the shared file store. Confirm how your Open WebUI release reads and writes object storage, which bucket permissions the task role needs, and whether your encryption and lifecycle rules match your retention policy. Ask what request volume your upload pattern generates, because object request charges and retrieval latency scale with how often each file is read.

AWS quotas and regional service availability

Confirm that your account has enough quota for the Fargate vCPU, load balancer, ElastiCache and RDS resources in the target region, and that every service in the design is offered there. Quota increases can take time to approve, so request them before the build starts. Ask whether the region has the instance classes and engine versions you need, and record the quota values you verified so the design can be reviewed later.

What does Open WebUI on AWS ECS and Fargate cost and take to build?

What drives the monthly AWS bill for Open WebUI on ECS Fargate?

The bill is the sum of the services the design uses, and the largest variables are the number of Fargate tasks and their CPU and memory size, the RDS PostgreSQL instance class and storage, the ElastiCache Redis node size, S3 storage and requests, the Application Load Balancer, and data transfer out of AWS. Redis is required once you run more than one replica, and PostgreSQL is required for multi-instance deployments, so those two services are not optional at scale. Ask your AWS account team or use the AWS pricing calculator with your expected user count, concurrency and region to model each line. Your own usage data, especially long streaming conversations and file uploads, will move the estimate more than any list price.

Which Open WebUI on AWS costs are one-time and which recur?

Most of the AWS infrastructure cost recurs every month, since Fargate tasks, RDS, ElastiCache, the load balancer, S3 storage and data transfer are billed on usage or uptime. The one-time costs are the design and build work: landing zone alignment, network and IAM setup, the migration task, initial configuration, identity integration, testing and handover. Ongoing costs also include the people who upgrade Open WebUI, patch the database engine, review logs and rotate secrets. Ask any partner to separate the build fee from a recurring support or retainer fee, and to state which AWS resources, if any, will be created in your account and who owns them.

How long does it take to build Open WebUI on ECS Fargate?

Duration depends mainly on whether your AWS environment already has a landing zone with networking, logging, encryption and an approved deployment pipeline, and on how many identity integrations and test cases are in scope. A team that has to build the network, IAM model and database layer from scratch will need far longer than one that adds a service to an existing account. No duration is fixed here because it depends on your environment. Ask for a written plan with phases, owners and acceptance tests before work starts, and treat any duration without that breakdown as an assumption.

Which effort drivers matter most for an ECS Fargate build?

Four factors usually decide the effort. The first is your existing AWS landing zone, including account structure, VPC design, egress controls and logging. The second is identity integration, since OIDC or LDAP, SCIM provisioning and group mapping each add configuration and testing. The third is the vector store choice: Open WebUI supports several vector databases, and the scaling guide warns that the default ChromaDB will crash in multi-process setups, so an external store such as PGVector on the existing PostgreSQL instance changes the design. The fourth is test coverage for streaming, WebSocket sessions, uploads and failover behavior. Each one should be listed in the scope before a quote is final.

What does the buyer's team need to provide for the build?

The buyer's team typically provides AWS account access under agreed roles, the target VPC and subnet layout, DNS and TLS certificate ownership, identity provider details and an admin contact for group mapping, the model provider endpoints and credentials policy, and a decision on who receives logs and alerts. Someone with authority over the AWS account must approve IAM roles, security group rules and the data classifications for stored prompts and uploaded files. Ask the partner to list these inputs in the written scope so that delays are visible and assigned to a named person on your side.

Can a team build Open WebUI on ECS Fargate without outside help?

Yes, a team with working experience in ECS, RDS, IAM and load balancing can build this design alone, and the Open WebUI scaling documentation describes the required components. The harder parts are the ones that do not appear in a tutorial: a safe migration task run order, Redis-backed session revocation, shared file storage, external vector store sizing, and a tested recovery path for the database. PostgreSQL does not detect primary failures or fail over by itself, so an automatic failover design needs additional tooling. Decide honestly whether your team has the time and skills to own these for the life of the system, and whether you want a fixed-scope build, an outside review, or a retainer for upgrades and testing.

How DeployOpen scopes and delivers Open WebUI on AWS ECS and Fargate

DeployOpen plans, implements, hardens, documents and supports self-hosted platforms inside the client's own AWS accounts. For Open WebUI on ECS and Fargate, we start from a written scope that names the services, network boundaries, identity model and handover items before any infrastructure is built.

How we scope

  • Confirm the Open WebUI version, install method and expected user count before choosing the replica and database design.
  • Map the AWS account structure, VPC layout, subnets, load balancer exposure and identity provider the deployment must use.
  • Agree in writing which data stores, task roles, migration steps, backups and test activities are included and excluded.

How we build

  • Provision RDS PostgreSQL with pgvector, ElastiCache Redis, S3 file storage and task roles from infrastructure definitions your team can review.
  • Configure the Application Load Balancer, WebSocket handling and health checks, then run schema migrations as a separate task before services start.
  • Test sign-in, streaming responses, file uploads, session revocation after sign-out and replica restarts before handing the environment over.

How we hand over

  • Deliver architecture notes, IAM and network diagrams, configuration references and the runbook for deploys, rollbacks and migrations.
  • Document backup and restore procedures for the database and S3 buckets, including the restore test results agreed in scope.
  • Walk your platform and security teams through access controls, secrets locations, logging and the open items that remain.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped separately from the initial build.
  • Plan Open WebUI release upgrades and PostgreSQL minor and major version updates as recurring work, with the change window agreed in advance.
  • Retest after material changes to the image, identity configuration or network path so the environment stays aligned with the written scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.