Skip to main content

31 posts tagged with "Cloud"

View All Tags

Beyond Heroku: Owning Your Deployments

· 7 min read
Defang Team

When you launch a new app, convenience rules. Platforms like Heroku offer a beautifully simple way to push code and see it live in minutes. You don’t need to think about servers, networks or databases. You just deploy. That’s why so many of us start there.

But convenience has a cost. As your product grows, you want more control over performance and security. You want to integrate your own services, tune the infrastructure and optimize your spend. Heroku’s dyno‑based pricing, which starts around $25/month for a modest dyno and climbs to hundreds of dollars for high‑performance dynos, can become prohibitive for serious production workloads. And while Heroku abstracts away the underlying cloud, that abstraction also means you can’t fine‑tune the way your application runs.

This trade‑off eventually becomes untenable. Teams need the simplicity of a platform like Heroku and the power and trust of running inside their own AWS account. This post unpacks why migrating off Heroku matters, highlights the friction points when you try to move to AWS yourself, and shows how the Defang CLI bridges the gap.

Heroku vs. AWS

Heroku is a Platform‑as‑a‑Service very focused on simplicity and ease of use, while AWS offers a huge array of extremely powerful services that can be difficult to navigate alone. What you get from Heroku is the ability to deploy your application with a simple git push, scale by adding dynos and pick from a marketplace of add‑ons. But you miss out on much of the power of AWS, like the ability to organize and network services the way you want, the ability to deploy in a huge number of regions, their reliability, and much of the control you need to be called enterprise-ready. AWS also tends to be more cost effective as you scale and offers a wide variety of scalable storage options including Postgres, MongoDB, Redis, and more.

Pricing and scale

Heroku’s pricing is tied to dynos. Eco dynos cost about $5/month for 1,000 hours, while standard dynos run $25–$50/month and performance dynos jump to $250–$1,500/month. Those numbers are predictable, but if your traffic spikes or you need more compute, your dyno bill scales quickly. Databases and Redis add‑ons are also billed per gigabyte, adding to the total cost.

AWS uses a pay‑as‑you‑go model: you pay for the exact resources you use, whether on‑demand compute, reserved instances or spot capacity. This model can be far cheaper at scale, especially if you commit to reserved or savings plans, but it also introduces complexity. Besides compute, you need to factor in elastic IPs, data transfer, load balancers and NAT gateways. AWS rewards expertise: you can optimize costs but only if you understand its pricing levers.

Why leave Heroku?

For many teams, Heroku is the right starting point. But there are clear inflection points when it makes sense to graduate:

  • Escalating costs. As your user base grows, dyno bills rise exponentially. At some point, the predictable price premium no longer justifies the convenience.

  • Performance and scalability demands. High‑traffic applications need flexible scaling and the ability to choose instance sizes and storage types. Heroku’s dyno types can be limiting for CPU‑ or memory‑intensive workloads.

  • Compliance and data sovereignty. Customers in regulated industries often require apps to run in their own cloud account and under their own compliance controls.

  • Customization. You might need to integrate bespoke networking, private databases or other services not available as Heroku add‑ons. AWS’s vast ecosystem of more than 240 services makes these integrations possible.

Yet the path off Heroku isn’t trivial. Re‑platforming often means rewriting your application to use AWS services directly, building new CI/CD pipelines, managing IAM roles and provisioning infrastructure by hand. That’s a big lift for developers who just want to ship features.

Migration in minutes: how the Defang CLI works

In our recent video (“How to migrate from Heroku to AWS in 5 minutes!”), we demonstrated a Django + Postgres app running on Heroku. The goal: deploy it into our own AWS account without rewriting anything. Here’s how it works:

Import your Heroku app. After installing and logging into the Defang CLI, run:

defang init

Then select Migrate from Heroku.

Defang connects to the Heroku API, inspects your app’s dynos, add‑ons and configuration variables, and generates a Docker Compose file. It translates Procfile commands into services and records dependencies like Postgres and Redis.

Review the Compose file. You should always examine the generated compose.yaml. You can adjust ports or remove unnecessary services. In the demo we changed the exposed port to 8000 and confirmed everything looked reasonable.

Select your cloud. We authenticated against AWS and selected a profile (AWS_PROFILE=defang-lab). In Defang, you set a provider with an environment variable DEFANG_PROVIDER=aws.

You can either export these, or pass them to each command:

AWS_PROFILE=defang-lab DEFANG_PROVIDER=aws defang <command>

Or you can set them as environment variables:

export AWS_PROFILE=defang-lab DEFANG_PROVIDER=aws

Set your secrets. You then run defang config set to provide any secrets (database user, password, database name) that were previously stored in Heroku. These secrets are encrypted at rest and passed securely to your services deployment.

Deploy with one command. Finally, execute:

defang up

Defang provisions an ECS cluster, RDS database, VPC, security groups, DNS records, load balancer, and more for your application. It also provisions a release service to handle migrations and brings up your web service once the database is ready. Eventually you get a public URL for your working application.

Verify and scale.

The entire migration took roughly five minutes from start to finish, with zero changes to application code. Instead of rewriting our Django settings or learning the intricacies of ECS, we let Defang automate the heavy lifting.

Why this matters

The migration from Heroku to AWS delivers two critical advantages that matter most to growing teams: cost savings and power and flexibility.

As we covered earlier, Heroku's dyno pricing can quickly escalate from $25/month to hundreds or even thousands as you scale. AWS's pay-as-you-go model, combined with reserved instances and spot capacity, can reduce your infrastructure costs by 60-80% at scale (depends on your use case). You pay only for what you use, when you use it.

More importantly, you gain access to AWS's full ecosystem of 240+ services. Need a specific instance type for CPU-intensive workloads? Custom networking for multi-region deployments? Advanced monitoring and logging? On Heroku, you're limited to what's available in their add-on marketplace. On AWS, you can integrate any service, tune performance at the infrastructure level, and architect solutions that simply aren't possible on a PaaS.

For some teams, there's also the benefit of deploying into customer cloud accounts for compliance and data sovereignty requirements.

Defang bridges this gap by giving you Heroku-like simplicity with AWS power.

Try it yourself

If your team is outgrowing Heroku or you need to bring your application into your customers’ cloud, give our migration workflow a spin. Install the Defang CLI, run defang init migrate-from-heroku, and watch your app come to life in AWS. You can find more details in our official migration guide. We’d love to hear what you deploy and what features you’d like us to add next.

Deployments in the Agentic Era

· 4 min read
Defang Team

If you want people to adopt your AI product, the deployment story has to be as strong as the features.

Over the past few decades, the software industry has gone through multiple major transitions. Each one reshaped not only how products are delivered, but also how they are trusted.

  • In the Client-Server Era (circa 2000), apps like SAP and PeopleSoft were purchased and deployed by the customer in their own "on-prem" environment. The customer was in control, but also took on the operational complexity of everything from procuring and deploying hardware to the system software and the apps themselves.
  • In the SaaS Era (circa 2010s), apps such as Salesforce and Workday ran in the provider's cloud and were delivered through the browser. While this simplified operations for the customer, it also meant that the customer data was trapped in these applications, with sometimes ambiguous data ownership and usage rules.
  • Today, we are entering the Agentic Era. Agentic apps promise to deliver an unprecedented productivity boost, but to do so, they need access to the most sensitive business data: conversations, documents, decisions. Customers do not want to transfer such data to an unknown and untrusted external provider's environment. Instead, they expect these products to run inside their cloud accounts (whether it be AWS, GCP, or any other), with their compliance, and under their security controls.

Agentic Era

This is not a small adjustment. It is the foundation of how the next generation of software will be trusted and adopted.

Why the Agentic Era Changes the Rules

AI products are not like SaaS tools. They do not just manage workflows, they ingest and act on the crown jewels of a business. To succeed in this environment, three conditions must hold true:

  • Data stays with the customer: no leaking sensitive content outside their environment.
  • Deployments work across clouds: AWS, GCP, Azure, or wherever the customer operates.
  • Security and compliance are built in: IAM, networking, and policies set up correctly from day one.

This is not a technical detail. It is the trust layer that determines whether adoption happens at all.

ekai's Example

ekai is an AI digital twin that boosts productivity by capturing meetings, surfacing action items, and acting as a Slack companion. To be trusted, it has to run inside the customer's cloud account.

ekai needed a single deployment solution that could run on any cloud and deliver a consistent, reliable experience with the same features everywhere. Like many AI builders, they faced the challenge of providing secure, compliant deployments across AWS, GCP, and other environments without spending weeks on custom DevOps for each customer.

That is where Defang came in.

With Defang, ekai defines its application once in Docker Compose. Defang turns that definition into a production-ready deployment inside the customer's own cloud account. Compute, storage, networking, IAM roles, security groups, and even managed LLMs are provisioned automatically, following best practices for each cloud.

What used to take weeks of engineering now happens in hours. More importantly, every deployment is secure, compliant, and customer-owned.

"Defang was the ideal choice for us. We simply describe ekai as a Docker Compose application, and Defang takes care of everything else. From compute and storage to IAM roles and managed LLMs, Defang ensures our deployments are secure, scalable, and cloud-native. That is a huge benefit for us and for our customers."

Ash Tiwari, Founder & CEO, ekai

Defang and the Agentic Era

ekai is not an isolated case. It is a preview of what the Agentic Era demands. As AI products move deeper into mission-critical workflows, deployment will decide adoption.

Defang exists to make this possible.

  • Define your app once, no matter the framework: CrewAI, LangGraph, AutoGen, Strands
  • Deploy to any cloud in a single step
  • Keep customer data inside customer environments
  • Align deployments with cloud-native best practices automatically

Just as SaaS platforms unlocked a decade of cloud adoption, Defang is the foundation for customer-owned AI.

The Takeaway

In the Agentic Era, trust is the product. The next wave of AI adoption will be decided not by features, but by where and how products run. Companies that respect data ownership and deliver secure, cloud-native deployments will earn trust and scale. Those that do not will be left behind.

Defang is the invisible infrastructure making this era possible.

August 2025 Defang Compose Update

· 4 min read
Defang Team

Defang Compose Update

August was about making migrations smoother and showing how you can already use Defang to deploy agentic apps at scale. We expanded our sample projects for popular multi-agent frameworks like CrewAI, LangGraph, Autogen, and Strands, validating them on Playground, AWS, and GCP so you can run multi-agent workloads in production without extra DevOps. Our new Heroku migration flow inspects dynos and add-ons, generates a clean Compose file, provisions managed equivalents like Postgres and Redis, and ships to your own cloud in one command. This cuts costs and removes lock-in. We also introduced MCP BYOC prompts so you can deploy to AWS and GCP straight from your IDE. Railpack on GCP now delivers faster, more reliable no-Dockerfile builds with clearer logs and closer parity with AWS.

Heroku Migration

As more and more teams are moving away from legacy PaaS solutions, looking for more flexibility and more control, we’ve made it easier for teams to move off Heroku. Defang now supports deployments without a Dockerfile and Defang will even generate a compose file from your Heroku application. The result is a smoother path to AWS or GCP with more features, lower costs, and no lock-in.

Agentic Applications

We expanded and refined our sample projects for agentic frameworks like CrewAI, LangGraph, Autogen, and Strands, validating across Playground, AWS, and GCP for a seamless move to production. Agentic applications demand more than code. They need scalable compute, managed databases and caches, security, orchestration, and LLM integrations. That’s why Defang automates all the heavy lifting. When you define your app once in Docker Compose, Defang handles provisioning on AWS or GCP including compute, managed Postgres or MongoDB, Redis, LLM services, security, auto scaling, and compliance so you can focus purely on your agents.

MCP BYOC Prompts

We now support deploying to AWS and GCP through the Defang MCP Server using prompts in your IDE. This keeps your workflow fast and frictionless, letting you go from code to cloud in seconds without breaking focus. You can stay in the flow with no context switching, spinning up services or scaling workloads simply by chatting in your editor. It means faster iteration, shorter feedback loops, and less time wrestling with terminals or cloud consoles.

note

Requires Defang CLI v2.1.3 or later.

Railpack GCP

Railpack now works more smoothly on GCP with fixes to image builds, provider consistency, and a redesigned repo. You’ll see faster first builds and rebuilds with better caching, clearer logs when something fails, and closer parity with AWS so templates behave the same across clouds. Railpack also auto-detects common stacks when no Dockerfile is present, applies sensible defaults for runtime, ports, and health checks, and produces clean OCI images for Playground or your own cloud. Net result: you can ship no-Dockerfile apps across clouds with less setup and fewer surprises.

Events and Community

In August, one of our campus advocates, Swapnendu Banerjee, hosted a session that showed how quickly you can deploy real apps to the cloud with Defang. Looking ahead, we’ll be at the ALL IN conference in Montreal this month and would love to connect if you’re a Defang user or planning to attend.

We are excited to see what you will deploy with Defang next. Join our Discord to ask questions, get support, and share your builds with the community.

More coming in September.

Deploying Agentic Apps to the Cloud Shouldn’t Be This Hard…

· 3 min read
Defang Team

Agentic Apps

Deploying Agentic Apps to the Cloud Shouldn’t Be This Hard…

Agentic apps are redefining how software is built: multi-agent workflows, persistent memory, tool-using LLMs, and orchestrated autonomy. But deploying them to the cloud is still painful - for example, your agentic app typically needs to provision:

  • Managed databases like Postgres or MongoDB
  • Fast, scalable caching (hello Redis)
  • Containerized compute that scales
  • Secure networking and service discovery
  • Managed LLMs like AWS Bedrock or GCP Vertex AI

And for many teams, these apps must run inside the customer’s cloud, where sensitive data lives and compliance rules apply. That means you cannot just spin up your own environment and call it a day. Instead, you are deploying across AWS, GCP, DigitalOcean, or whichever stack your customers demand, each with its own APIs, quirks, and limitations.

Now you are not just building agents; you are picking the right infrastructure, rewriting IaC templates for every provider, and untangling the edge cases of each cloud.

The result: weeks of DevOps headaches, lost momentum, and engineers stuck wiring infrastructure instead of shipping agents.

We Made it Simple with Cloud Native Support for Agentic Apps

That’s where Defang comes in. We make it easy to deploy full-stack agentic apps to your cloud of choice: native, secure, and scalable. Defang understands the common ingredients of agentic apps and makes them first-class citizens:

  • Compute: Your Dockerized services deploy as cloud-native workloads (e.g. AWS ECS, or GCP Cloud Run)
  • Databases: Provision managed Postgres or MongoDB with one config line
  • Caching: Add Redis and Defang spins up a managed Redis instance in your cloud
  • LLMs: Integrate directly with Bedrock or Vertex AI - even provision an OpenAI gateway for compatibility with OpenAI APIs.
  • Secure Defaults: : TLS, secrets, IAM, and service accounts handled out of the box

Built for All your Favorite Agentic Frameworks

Defang works seamlessly with leading agentic frameworks. Try them out with our ready-to-deploy samples:

  • Autogen - demo featuring Mistral AI + FastAPI, deployable with Defang’s OpenAI Access Gateway.
  • CrewAI - sample app showing multi-agent orchestration in action.
  • LangGraph - workflow sample that defines and controls multi-step agentic graphs with LangChain.
  • Agentic Strands - A Strands Agent application.

More framework templates coming soon.

Why It Matters

Agentic apps need to be fast, secure, and ready to scale. Defang delivers cloud-native deployments in your environment (AWS, GCP, DO), so you can move from idea to production quickly with consistent behavior across dev, test, and prod.

The Developer Journey, Simplified

  1. Build your agentic app locally using Docker Compose
  2. Test in Defang's free playground with defang compose up
  3. Deploy to your cloud:
defang compose up --provider=aws  # or gcp, digitalocean

It just works. No Terraform. No YAML explosion. No vendor lock-in.

The Future of AI Apps Is Agentic and Cloud-Native

Agility and scalability should not be a trade-off. With Defang, you get both. Developers focus on agents, tools, and outcomes. Defang takes care of the cloud infrastructure.

Try it out

Explore more samples at docs.defang.io Join our community on Discord

July 2025 Defang Compose Update

· 3 min read
Defang Team

Defang Compose Update

July was all about making cloud deployments even smoother and smarter. We focused on removing friction from deployments and giving you better visibility into costs. Railpack now builds production-ready images automatically when no Dockerfile is present, and our real-time cost estimation feature now supports Google Cloud alongside AWS. We also added managed MongoDB on GCP, introduced an Agentic LangGraph sample, and connected with builders at Bière & Code & Beer MTL. Here’s what’s new.

Railpack Integration

We’ve integrated Railpack into Defang to make deployments even smoother. Railpack automatically builds OCI-compliant images from your source code with minimal configuration. This helps eliminate one of the most common issues our users face: missing or invalid Dockerfiles, especially when they’re generated by LLMs or created by users with limited Docker experience. Now, if no Dockerfile is provided, Defang will seamlessly use Railpack to build a working image for you, so you can focus on your code, not your container setup.

GCP Cost Estimation

In June, Defang announced real-time cost estimation for AWS. In July, we took our live cloud cost estimation to the next level by extending support to GCP. Defang now makes it easy to compare real-time pricing for both cloud providers. All you need is your project's compose.yaml file. Whether you’re optimizing for cost, performance, or flexibility, Defang makes it easy to get the information you need to deploy with confidence.

Managed MongoDB on GCP

Defang now supports managed MongoDB on GCP through MongoDB-compatible APIs provided by Google Cloud. This integration allows you to spin up a fully managed Firestore datastore and interact with it just like a standard MongoDB instance without any manual setup or configuration.

Agentic LangGraph Sample

We have published a new Agentic LangGraph sample project that demonstrates LangGraph agent deployment with Defang. As AI agent development grows, Defang makes it simple to deploy and scale agents, including those built with LangChain or LangGraph. You can explore the example to see how it works in practice.

Events and Community

In July, we hosted the Bière & Code & Beer MTL during Startupfest in Montreal. It was an incredible evening with great energy, tech conversations, and the chance to connect with so many talented builders over drinks.

We are excited to see what you will deploy with Defang next. Join our Discord to ask questions, get support, and share your builds with the community.

More coming in August.

Defang: Your AI DevOps Agent

· 4 min read
Defang Team

Defang Agent

From Vibe-Coding to Production… Without a DevOps Team

Building apps has never been easier. Tools like Cursor, Windsurf, Lovable, V0, and Bolt have ushered in a new era of coding called vibe coding, rapid, AI-assisted app development where developers can go from idea to prototype in hours, bringing ideas to life faster than ever before.

And with the recently released AWS Kiro, we have now entered a new phase of AI-assisted development called "spec-driven development" where the AI breaks down the app development task even further. You can think of a "PM agent" that goes from prompt to a requirements document, and then an "Architect agent" that goes from the requirements document to a design document, which is then used by "Dev", "Test" and "Docs" agents to generate app code, tests, and documentation respectively. This approach is much more aligned with enterprise use cases and produces higher quality output.

The Hard Part Isn’t Building. It’s Shipping.

However, cloud app deployment remains a major challenge! As Andrej Karpathy shared during his recent YC talk:

"I vibe-coded the app in four hours… and spent the rest of the week deploying it."

While AI-powered tools make building apps a breeze, deploying them to the cloud is still frustratingly complex. Kubernetes, Terraform, IAM policies, load balancers, DNS, CI/CD all add layers of difficulty. This complexity continues to be a significant bottleneck that AI tools have yet to fully address, making deployment a critical challenge for developers.

The bottleneck is no longer the code. It's the infrastructure.

Enter Defang: Your AI DevOps Agent

Defang is an AI-enabled agent that takes care of your entire deployment workflow, going from app code to a production-ready deployment on your favorite cloud in a single step.

By understanding your app stack (using Docker Compose), Defang provisions the right infrastructure and securely deploys to AWS, GCP, or DigitalOcean, following each cloud's best practices.

Whether you're launching a side project or scaling a multi-agent app, Defang ensures secure, smooth, scalable cloud-native deployments.

Defang Deployment Features at a Glance

  • One Command Deployment: Run defang compose up and you're live
  • Secure and Scalable: Built-in TLS, secrets, autoscaling, IAM, and HTTPS
  • Multi-Cloud Ready: Deploy to your cloud (AWS, GCP, DO) using your own credentials
  • Language & framework agnostic: Next.js, Go, Python (Django/Flask), C#, …
  • Managed LLM: Add x-defang-llm: true and Defang auto-configures cloud-native LLMs like Bedrock, Vertex AI, and the Defang Playground
  • Configures managed services (e.g. managed Postgres, MongoDB, Redis) using the target cloud's native services (e.g. RDS for Postgres on AWS, Cloud SQL on GCP).
  • Tailored deployment modes (e.g. affordable, balance, high-availability) optimized for different environments (dev, staging, production)
  • AI Debugging: Get context-aware assistance to quickly identify and fix deployment issues

Native Integration with AI-Assisted Coding Tools

Defang can be accessed directly from within your favorite IDE - Cursor, Windsurf, VS Code, Claude, or Kiro - via Defang's MCP Server. You can now deploy to the cloud with a natural language command like "deploy my app with Defang".

For Developers and CTOs Who Want to Move Fast

If you're a developer shipping fast or a CTO scaling lean, Defang acts as your drop-in DevOps engineer without needing to build a team around it.

You focus on building great software.
Defang gets it live.

Try Defang Now

June 2025 Defang Compose Update

· 3 min read
Defang Team

Defang Compose Update

June was a big month at Defang. We rolled out powerful features across our CLI, Playground, and Portal, expanded support for both AWS and GCP, and introduced new tools to help you ship faster and smarter. From real-time cloud cost estimation to internal infra upgrades and community highlights, here’s everything we accomplished.

🚀 Live AWS Cost Estimation

We just launched something we’re really excited about: live AWS cost estimation before you deploy. Most devs ship to the cloud without knowing what it’s going to cost and that’s exactly the problem we’re solving. With Defang, you can now estimate the cost of deployment of an Docker Compose application and choose the deployment mode - affordable / balanced / high_availability - that best suits your needs.

👉 Check out the docs

🧠 CrewAI + Defang Starter Kit

In June, we launched a full-stack starter kit for building real-time RAG and multi-agent apps with CrewAI + Defang. It’s designed to help you move fast with a production-style setup — including Django, Celery, Channels, Postgres (with pgvector), Redis for live updates, and Dockerized model runners you can easily customize. CrewAI handles the agent workflows, and with Defang, you can deploy the whole thing to the cloud in a single command. Whether you’re building a smart Q&A tool or a multi-agent research assistant, this stack gives you everything you need to get started.

👉 Try it out here

📊 Deployment Info in Portal

We’ve added active deployment information to the Defang Portal. You can now see your currently active deployments across various cloud providers and understand the details of each, while still managing your cloud environments through the provider’s own tools (e.g. the AWS Console).

☁️ Playground Now Runs on AWS + GCP

Internally, we also hit a big milestone: The Defang Playground now runs on both AWS and GCP, showing the power of Defang’s multi-cloud infrastructure. We’ve also enabled load balancing between the two platforms and plan to share a detailed blog post on how it works soon.

🧩 VS Code Extension Released

We also released the Defang VS Code Extension, making it even easier to deploy and manage cloud apps right from your editor. No terminal needed.

  • One-click deploy
  • Built-in tools to manage services
  • Zero config, fast setup

👉 Try it out here

💬 Ask Defang via Intercom

You can now try out the Ask Defang chatbot directly within Intercom! This new integration makes it easier than ever to get instant answers and support while you work. Ask Defang itself is deployed using Defang to our own cloud infrastructure.

🐳 Docker x Defang White Paper

And one more thing: bridging local development and cloud deployment just got easier. We’ve published white papers on how Defang extends Docker Compose and GCP workflows to the cloud — using familiar tools at scale. An AWS white paper is coming soon.

👉 Read the white paper here

👉 Read the GCP white paper

Events and Community

In June, we showcased a powerful new demo at AWS events: “What If You Could See AWS Costs Before You Deployed?” Jordan Stephens walked through how to go from Docker Compose to AWS infra with real-time cost estimates and easy teardown, all via Defang.

👉 Watch the demo here

We can’t wait to see what you deploy with Defang.
👉 Join our Discord

More coming in July.

Sample: Starter Kit for RAG + Agents with CrewAI

· 7 min read
Defang Team

Why Build a Starter Kit for RAG + Agents?

Let’s be honest: every developer who’s played with LLMs gets that rush of “wow” from the first working demo. But the real headaches show up when you need to stitch LLMs into something production-grade: an app that can pull in real data, coordinate multi-step logic, and more. Suddenly, you’re not just writing single prompts. You’re coordinating between multiple prompts, managing queues, adding vector databases, orchestrating workers, and trying to get things back to the user in real-time. We've found that CrewAI (coordinating prompts, agents, tools) + Django (building an api, managing data), with a bit of Celery (orchestrating workers/async tasks), is a really nice set of tools for this. We're also going to use Django Channels (real-time updates) to push updates back to the user. And of course, we'll use Defang to deploy all that to the cloud.

If this sounds familiar (or if you're dreading the prospect of dealing with it), you’re the target audience for this sample. Instead of slogging through weeks of configuration and permissions hell, you get a ready-made template that runs on your laptop, then scales—unchanged—to Defang’s Playground, and finally to your own AWS or GCP account. All the gnarly infra is abstracted, so you can focus on getting as much value as possible out of that magical combo of CrewAI and Django.

Just want the sample?

You can find it here.

A Demo in 60 Seconds

Imagine you're building a system. It might use multiple LLM calls. It might do complex, branching logic in its prompts. It might need to store embeddings to retrieve things in the future, either to pull them into a prompt, or to return them outright. It might need to store other records that don't have embeddings. Here's a very lightweight version of a system like that, as a starting point:

Architecture at a Glance

Behind the scenes, the workflow is clean and powerful. The browser connects via WebSockets to our app using Django Channels. Heavy work is pushed to a Celery worker. That worker generates an embedding, checks Postgres with pgvector for a match, and either returns the summary or, if there’s no hit, fires up a CrewAI agent to generate one. Every update streams back through Redis and Django Channels so users get progress in real time.

Architecture

Durable state lives in Postgres and Redis. Model services (LLMs and embeddings) are fully swappable, so you can upgrade to different models in the cloud or localize with the Docker Model Runner without rewriting the full stack.

Under the Hood: The Services

Django + Channels

The Django app is the front door, routing HTTP and WebSocket traffic, serving up the admin, and delivering static content. It’s built on Daphne and Django Channels, with Redis as the channel layer for real-time group events. Django’s admin is your friend here: to start you can check what summaries exist, but if you start building out your own app, it'll make it a breeze to debug and manage your system.

PostgreSQL + pgvector

This is where your data lives. Summaries and their 1024-dimension embeddings go here. A simple SQL query checks for close matches by cosine distance, and pgvector’s index keeps search blazing fast. In BYOC (bring-your-own-cloud) mode, flip a single flag and Defang provisions you a production-grade RDS instance.

Redis

Redis is doing triple duty: as the message broker and result backend for Celery, and as the channel layer for real-time WebSocket updates. The pub/sub system lets a single worker update all browser tabs listening to the same group. And if you want to scale up, swap a flag and Defang will run managed ElastiCache in production. No code change required.

Celery Worker

The Celery worker is where the magic happens. It takes requests off the queue, generates embeddings, checks for similar summaries, and—if necessary—invokes a CrewAI agent to get a new summary. It then persists summaries and pushes progress updates back to the user.

LLM and Embedding Services

Thanks to Docker Model Runner, the LLM and embedding services run as containerized, OpenAI-compatible HTTP endpoints. Want to switch to a different model? Change a single line in your compose file. Environment variables like LLM_URL and EMBEDDING_MODEL are injected for you—no secret sharing or hard-coding required.

CrewAI Workflows

With CrewAI, your agent logic is declarative and pluggable. This sample keeps it simple—a single summarization agent—but you can add classification, tool-calling, or chain-of-thought logic without rewriting your task runner.

How the Compose Files Work

In local dev, your compose.local.yaml spins up Gemma and Mixedbread models, running fully locally and with no cloud credentials or API keys required. URLs for service-to-service communication are injected at runtime. When you’re ready to deploy, swap in the main compose.yaml which adds Defang’s x-defang-llm, x-defang-redis, and x-defang-postgres flags. Now, Defang maps your Compose intent to real infrastructure—managed model endpoints, Redis, and Postgres—on cloud providers like AWS or GCP. It handles all networking, secrets, and service discovery for you. There’s no YAML rewriting or “dev vs prod” drift.

The Three-Step Deployment Journey

You can run everything on your laptop with a single docker compose -f ./compose.local.yaml up command—no cloud dependencies, fast iteration, and no risk of cloud charges. When you’re ready for the next step, use defang compose up to push to the Defang Playground. This free hosted sandbox is perfect for trying Defang, demos, or prototyping. It automatically adds TLS to your endpoints and sleeps after a week. For production, use your own AWS or GCP account. DEFANG_PROVIDER=aws defang compose up maps each service to a managed equivalent (ECS, RDS, ElastiCache, Bedrock models), wires up secrets, networking, etc. Your infra. Your data.

Some Best Practices and Design Choices

This sample uses vector similarity to try and fetch summaries that are semantically similar to the input. For more robust results, you might want to embed the original input. You can also think about chunking up longer content for finer-grained matches that you can integrate in your CrewAI workflows. Real-time progress via Django Channels beats HTTP polling, especially for LLM tasks that can take a while. The app service is stateless, which means you can scale it horizontally just by adding more containers which is easy to specify in your compose file.

Going Further: Extending the Sample

You’re not limited to a single summarization agent. CrewAI makes it trivial to add multi-agent flows (classification, tool use, knowledge retrieval). For big docs, chunk-level embeddings allow granular retrieval. You can wire in tool-calling to connect with external APIs or databases. You can integrate more deeply with Django's ORM and the PGVector tooling that we demo'd in the sample to build more complex agents that actually use RAG.

Ready to Build?

With this sample, you’ve got an agent-ready, RAG-ready backend that runs anywhere, with no stacks of YAML or vendor lock-in. Fork it, extend it, productionize it: scale up, add more agents, or swap in different models, or more models!

Quickstart:

# Local
docker compose -f compose.local.yaml up --build
# Playground
defang compose up
# BYOC
# Setup credentials and then swap <provider> with aws or gcp
DEFANG_PROVIDER=<provider> defang compose up

Want more? File an issue to request a sample—we'll do everything we can to help you deploy better and faster!

Bridging Local Development and Cloud Deployment

· 2 min read
Defang Team

Introducing Our New Whitepaper: Bridging Local Development and Cloud Deployment with Docker Compose and Defang

We’re excited to announce the release of our new whitepaper, "Bridging Local Development and Cloud Deployment with Docker Compose and Defang."

Want to skip the blog?

Modern software development moves fast, but deploying to the cloud often remains a complex hurdle. Docker Compose revolutionized local development by providing a simple way to define multi-service apps, but translating that simplicity into cloud deployment has remained challenging—until now.

Defang bridges this gap by extending Docker Compose into native cloud deployments across AWS, GCP, DigitalOcean, and more, all with a single command: defang compose up. This integration empowers developers to:

  • Use familiar Docker Compose definitions for cloud deployment.
  • Enjoy seamless transitions from local to multi-cloud environments.
  • Automate complex infrastructure setups including DNS, networking, autoscaling, managed storage, and even managed LLMs.
  • Estimate cloud costs and choose optimal deployment strategies (affordable, balanced, or high availability).

Our whitepaper dives deep into how Docker Compose paired with Defang significantly reduces complexity, streamlines workflows, and accelerates development and deployment.

Discover how Docker + Defang can simplify your journey from local development to production-ready deployments across your preferred cloud providers.

May 2025 Defang Compose Update

· 3 min read
Defang Team

Defang Compose Update

May was a big month at Defang. We shipped support for managed LLMs in Playground, added MongoDB support on AWS, improved the Defang MCP Server, and dropped new AI samples to make deploying faster than ever.

🚀 Managed LLMs in Playground

You can now try managed LLMs directly in the Defang Playground. Defang makes it easy to use cloud-native language models across providers — and now you can test them instantly in the Playground.

  • Managed LLM support
  • Playground-ready
  • Available in CLI v1.1.22 or higher

To use managed language models in your own Defang services, just add x-defang-llm: true — Defang will configure the appropriate roles and permissions for you.

Already built on the OpenAI API? No need to rewrite anything.

With Defang's OpenAI Access Gateway, you can run your existing apps on Claude, DeepSeek, Mistral, and more — using the same OpenAI format.

Learn more here.

Try it out here.

📦 MongoDB Preview on AWS

Last month, we added support for MongoDB-compatible workloads on AWS via Amazon DocumentDB.

Just add this to your compose.yaml:

services:
db:
x-defang-mongodb: true

Once you add x-defang-mongodb: true, Defang will auto-spin a DocumentDB cluster in your AWS — no setup needed.

🛠 MCP Server Improvements

We've made the MCP Server and CLI easier to use and deploy:

  • Users are now prompted to agree to Terms of Service via the portal login
  • MCP Server and CLI are now containerized, enabling faster setup, smoother deployments, and better portability across environments

🌎 Events and Community

We kicked off the month by sponsoring Vancouver's first Vibe Coding IRL Sprint. Jordan Stephens from Defang ran a hands-on workshop on "Ship AI Faster with Vertex AI" with GDG Vancouver (GDG Vancouver). Around the same time, our CTO and Co-founder Lio joined the GenAI Founders Fireside panel hosted by AInBC and AWS.

Big moment for the team — we won the Best Canadian Cloud Award at the Vancouver Cloud Summit. Right after, we hit the expo floor at Web Summit Vancouver as part of the BETA startup program and got featured by FoundersBeta as one of the Top 16 Startups to Watch.

Our Campus Advocates also kept the momentum going, hosting Defang events around the world with live demos and workshops.

Last month's Defang Coffee Chat brought together the community for product updates, live demos, and a great convo on vibe deploying.

We're back again on June 25 at 10 AM PST. Save your spot here.

We can't wait to see what you deploy with Defang. Join our Discord to ask questions, get support, and share your builds.

More coming in June.