Dev.to AI 🤖 Ai 👁 0 📖 3 min read

How to Run a Private LLM Stack (Open WebUI + Ollama + vLLM) Inside Your AWS VPC with Zero Data Egress

Running LLMs against internal codebases, financial records, or customer tickets quickly hits a compliance wall: most security teams will not sign off on sending proprietary data to external SaaS model endpoints. Deployi

Running LLMs against internal codebases, financial records, or customer tickets quickly hits a compliance wall: most security teams will not sign off on sending proprietary data to external SaaS model endpoints.

Deploying an open-weights inference stack inside your own AWS VPC solves the data-egress problem—but wiring up NVIDIA drivers, CUDA toolkits, Docker GPU runtimes, Ollama, vLLM, Open WebUI, HTTPS termination, and OS hardening from scratch routinely burns half a day before the first prompt ever runs.

Here is the production checklist we use for deploying a private Open WebUI + Ollama + vLLM inference sandbox on AWS EC2 with zero third-party data egress.

1. Choosing the Right AWS GPU Instance

Match your instance family to VRAM and concurrency rather than raw vCPU count:

Workload Recommended EC2 Instance GPU / VRAM Best Runtime
Small team chat, 7B–14B quantized models g6.xlarge or g5.xlarge 1× L4 / A10G (24 GB) Ollama (fast startup, easy model switching)
High-throughput OpenAI-compatible API, 8B–32B models g6.4xlarge or g5.12xlarge 24–96 GB VRAM vLLM (continuous batching, PagedAttention)
Low-cost PoC / evaluation g4dn.xlarge 1× T4 (16 GB) Ollama (Q4_K_M models up to ~14B)

Storage tip: Don't skimp on the root or model EBS volume. Allocate at least 80–150 GB of gp3 so downloading multiple 8B–70B weights does not exhaust disk space mid-pull.

2. Hardening Checklist Before Exposing Open WebUI

Most quickstart tutorials bind port 3000 or 8080 directly to 0.0.0.0 with open signup enabled—a recipe for cryptojacking or unauthorized GPU consumption. Lock down five things on boot:

  1. No public SSH (port 22): Use AWS Systems Manager (SSM) Session Manager via an instance profile (AmazonSSMManagedInstanceCore), or restrict SSH strictly to key-only access from your corporate CIDR.
  2. Disable public self-registration: In Open WebUI, set ENABLE_SIGNUP=false after creating your initial admin account so anyone who discovers the endpoint cannot register and burn GPU cycles.
  3. Terminate TLS in front of the app: Put Caddy or Nginx with HTTPS in front of Open WebUI and keep Ollama (11434) and vLLM (8000) bound strictly to 127.0.0.1.
  4. Host firewall & intrusion defense: Enable ufw (allow only HTTPS from your corporate IP / ALB), fail2ban, auditd, and unattended OS security updates.
  5. Private VPC egress rules: Once models are cached locally on EBS (or pulled from an internal S3 mirror), you can even restrict outbound internet egress entirely.

3. Verifying Your GPU & Inference Runtime

Once the instance boots, verify the CUDA runtime and local inference endpoints over SSM before sharing the URL with your team:

# 1. Confirm NVIDIA driver + CUDA visibility
nvidia-smi

# 2. Verify Ollama local API is bound to loopback only
ss -tlnp | grep 11434
curl -s http://127.0.0.1:11434/api/tags

# 3. Pull a fast starter model and run a sanity prompt
ollama pull qwen2.5:7b-instruct
ollama run qwen2.5:7b-instruct "Summarize the benefits of VPC-isolated LLM inference in 3 bullets."

If you need higher concurrent throughput for internal apps or coding assistants, switch the backend to vLLM serving an OpenAI-compatible /v1/chat/completions endpoint on 127.0.0.1:8000 and point Open WebUI's OpenAI API base URL to it.

4. Skip the Setup: Pre-Hardened AMIs on AWS Marketplace

If you want this entire stack—NVIDIA drivers, CUDA runtime, Open WebUI, Ollama, optional vLLM, HTTPS proxy, UFW, fail2ban, audit logging, and signup disabled by default—booting cleanly in minutes inside your own AWS account with consolidated AWS Marketplace billing:

All workloads run strictly inside your own AWS account with zero third-party data egress, and AWS Marketplace billing consolidates directly onto your existing AWS invoice.

Questions or custom enterprise deployment specs? Reach us anytime at [email protected].

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.