DEV Community

Cover image for Deploy Your Own Private ChatGPT on AWS in 30 Minutes
J.Goutin
J.Goutin

Posted on

Deploy Your Own Private ChatGPT on AWS in 30 Minutes

What if you could deploy a fully private ChatGPT alternative — on your own AWS infrastructure, with your own data sovereignty rules — in 30 minutes?

No data leaving your account. No vendor lock-in. No per-user subscriptions. Just 3 Terraform commands.

Here's how.

The Stack

Component Role
Open WebUI ChatGPT-like interface (100,000+ ⭐ on GitHub)
stdapi.ai OpenAI-compatible API gateway for AWS
AWS Bedrock Access to 80+ foundation models

stdapi.ai sits between Open WebUI and AWS Bedrock, translating OpenAI API calls into native AWS requests. Any tool that speaks the OpenAI protocol — Open WebUI, n8n, VS Code AI assistants, custom apps — works immediately. No plugins, no custom integrations.

User → Open WebUI → stdapi.ai → AWS Bedrock → Claude Opus 4.6, DeepSeek, Kimi, Mistral…
                                             → AWS Polly (text-to-speech)
                                             → AWS Transcribe (speech-to-text)
Enter fullscreen mode Exit fullscreen mode

What You Get

  • 80+ AI models — Claude Opus 4.6, DeepSeek, Kimi, Mistral, Cohere, Stability AI, and more
  • Full multi-modal support — Chat, voice input/output, image generation/editing, document RAG
  • Multi-region access — Configure multiple AWS regions for the widest model selection and availability
  • Pay-per-use — No ChatGPT subscriptions, no per-seat fees. You pay only for actual AWS Bedrock usage
  • Production-ready infrastructure — ECS Fargate with auto-scaling, Aurora PostgreSQL + pgvector for RAG, ElastiCache Valkey, dedicated VPC, HTTPS with ALB

Data Sovereignty & Compliance

This is where it gets interesting for regulated industries:

  • Region restrictions — Lock inference to specific AWS regions matching your compliance requirements (GDPR, HIPAA, data residency laws, industry regulations)
  • No data shared with model providers — AWS Bedrock does not share your inference data with model providers
  • No training on your data — Your prompts and responses are never used for model training
  • Everything stays in your AWS account — No external data transmission beyond AWS services
  • Dedicated VPC — Isolated network for your AI workloads

Whether you need to keep data in the EU, in specific US regions, or within national boundaries for government requirements — you configure the allowed regions and stdapi.ai enforces it.

Deploy in 30 Minutes

git clone https://github.com/stdapi-ai/samples.git
cd samples/getting_started_openwebui/terraform

# ⚙️ Customize your settings (regions, models, scaling…)
# → Check the full documentation in the repo to tailor the deployment to your needs

terraform init && terraform apply
Enter fullscreen mode Exit fullscreen mode

That's it. 3 commands.

What Terraform deploys for you:

  • Open WebUI on ECS Fargate with auto-scaling
  • stdapi.ai as the OpenAI-compatible AI gateway
  • Aurora PostgreSQL with pgvector extension for RAG
  • ElastiCache Valkey for caching
  • Dedicated, isolated VPC with HTTPS via ALB
  • All environment variables pre-configured and ready to go

How stdapi.ai Works Under the Hood

stdapi.ai is more than a simple proxy. It's an AI gateway purpose-built for AWS that:

  • Translates the OpenAI API — Chat completions, embeddings, images (generation/editing/variations), audio (speech/transcription/translation), and model listing
  • Handles multi-region routing — Automatically selects the best region and inference profile for each model
  • Exposes advanced Bedrock features — Prompt caching, reasoning modes (extended thinking), guardrails, service tiers, and model-specific parameters
  • Integrates native AWS AI services — Amazon Polly for TTS, Amazon Transcribe for STT with speaker diarization, Amazon Translate

Your existing OpenAI-powered tools work without modification. Change the base URL, and you're on AWS.

Who Is This For?

  • Teams that want a private ChatGPT with full data control
  • Regulated industries (finance, healthcare, government) that need data residency guarantees
  • Companies tired of paying per-seat ChatGPT subscriptions when usage varies wildly
  • Developers who want to use the OpenAI ecosystem on AWS infrastructure
  • Ops engineers who want production-grade AI infrastructure as code

Get Started

📦 Deployment repo: github.com/stdapi-ai/samples

📖 Documentation: stdapi.ai

📩 Need help? We can help you deploy and customize this solution for your needs. Reach out to us.


3 commands. 30 minutes. Your private ChatGPT is in production. 🎯

Top comments (0)