Need advice about which tool to choose?Ask the StackShare community!
Ansible vs Docker Compose: What are the differences?
Developers describe Ansible as "Radically simple configuration-management, application deployment, task-execution, and multi-node orchestration engine". Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. Ansible’s goals are foremost those of simplicity and maximum ease of use. On the other hand, Docker Compose is detailed as "Define and run multi-container applications with Docker". With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.
Ansible and Docker Compose are primarily classified as "Server Configuration and Automation" and "Container" tools respectively.
"Agentless", "Great configuration " and "Simple" are the key factors why developers consider Ansible; whereas "Multi-container descriptor", "Fast development environment setup" and "Easy linking of containers" are the primary reasons why Docker Compose is favored.
Ansible and Docker Compose are both open source tools. It seems that Ansible with 37.8K GitHub stars and 15.8K forks on GitHub has more adoption than Docker Compose with 16.4K GitHub stars and 2.52K GitHub forks.
According to the StackShare community, Ansible has a broader approval, being mentioned in 955 company stacks & 578 developers stacks; compared to Docker Compose, which is listed in 787 company stacks and 608 developer stacks.
I'm just getting started using Vagrant to help automate setting up local VMs to set up a Kubernetes cluster (development and experimentation only). (Yes, I do know about minikube)
I'm looking for a tool to help install software packages, setup users, etc..., on these VMs. I'm also fairly new to Ansible, Chef, and Puppet. What's a good one to start with to learn? I might decide to try all 3 at some point for my own curiosity.
The most important factors for me are simplicity, ease of use, shortest learning curve.

I have been working with Puppet and Ansible. The reason why I prefer ansible is the distribution of it. Ansible is more lightweight and therefore more popular. This leads to situations, where you can get fully packaged applications for ansible (e.g. confluent) supported by the vendor, but only incomplete packages for Puppet.
The only advantage I would see with Puppet if someone wants to use Foreman. This is still better supported with Puppet.
If you are just starting out, might as well learn Kubernetes There's a lot of tools that come with Kube that make it easier to use and most importantly: you become cloud-agnostic. We use Ansible because it's a lot simpler than Chef or Puppet and if you use Docker Compose for your deployments you can re-use them with Kubernetes later when you migrate
Pros of Ansible
- Agentless282
- Great configuration208
- Simple197
- Powerful175
- Easy to learn153
- Flexible67
- Doesn't get in the way of getting s--- done54
- Makes sense34
- Super efficient and flexible30
- Powerful27
- Dynamic Inventory11
- Backed by Red Hat9
- Works with AWS7
- Cloud Oriented6
- Easy to maintain6
- Because SSH4
- Multi language4
- Easy4
- Simple4
- Procedural or declarative, or both4
- Simple and powerful4
- Consistency3
- Vagrant provisioner3
- Debugging is simple2
- Fast as hell2
- Well-documented2
- Merge hash to get final configuration similar to hiera2
- Masterless2
- Manage any OS1
- Certified Content1
- Work on windows, but difficult to manage1
Pros of Docker Compose
- Multi-container descriptor123
- Fast development environment setup110
- Easy linking of containers79
- Simple yaml configuration68
- Easy setup60
- Yml or yaml format16
- Use Standard Docker API12
- Open source8
- Go from template to application in minutes5
- Can choose Discovery Backend5
- Scalable4
- Easy configuration4
- Kubernetes integration4
- Quick and easy3
Sign up to add or upvote prosMake informed product decisions
Cons of Ansible
- Dangerous8
- Hard to install5
- Doesn't Run on Windows3
- Bloated3
- Backward compatibility3
- No immutable infrastructure2
Cons of Docker Compose
- Tied to single machine9
- Still very volatile, changing syntax often5