I Thought Docker Was About Making My App Work Everywhere. I Was Wrong.
Every time I tried learning Docker, I'd come across the same phrase:
"But it works on my machine!"
And every time, I'd think, okay, but isn't that what hosting is for?
I mean, we build an application locally, deploy it on a server or a hosting platform, and now people can access it from anywhere. So where exactly does Docker come in?
For the longest time, I thought Docker was just another way of doing that.
And honestly, the phrase "works on my machine" wasn't helping either. I took it quite literally. I thought the whole point was to make something that worked on my laptop work on everyone else's laptop too.
Which, in my head, was already a solved problem.
So Docker just felt like an extra step I couldn't quite justify.
Turns out, I was asking the wrong question.
The problem Docker was trying to solve wasn't really "How do I make my application available to everyone?"
It was more like:
"How do I make sure this application runs the same way when I move it somewhere else?"6
And those are two very different things.
Let's say I've built a backend on my laptop. Everything works perfectly. I've got the right Node.js version, the required packages, environment variables, and whatever else my application needs.
Now someone else tries running the same code.
Their Node version is different. Maybe they're missing a dependency. Maybe something is configured differently.
Same code. Different environment. Suddenly, things aren't working anymore.
That's the "works on my machine" problem.
Not that other people can't access my application, but that the application itself might not run properly in another environment.
And that's where Docker started making sense.
So what does Docker actually do?
The way I understand it now, Docker lets me package my application along with the dependencies and runtime setup it needs into an image.
That image can then be used to run a container on another machine with a compatible container runtime.
Instead of telling someone:
"Install this version of Node, then these dependencies, configure this, make sure that is running..."
I can give them a much more consistent starting point.
Of course, it doesn't magically fix everything. Environment variables, databases, networking, storage, and differences between systems still matter.
But it removes a lot of the "wait, what version are you using?" kind of problems.
And that's a pretty big deal.
The part that finally connected the dots
I was working on MyVigi, a full-stack project, and had started splitting parts of its backend into separate services.
There was a core backend, a notification service, an SOS service, and eventually an API gateway.
Now I wasn't dealing with just one application process anymore.
I had multiple services, different ports, and communication between them to think about.
This is where Docker Compose became useful.
Instead of starting and managing every service individually, I could define how they should run together and bring them up with a command.
docker compose up -d And seeing those services running as containers made the concept feel a lot less abstract.
I could finally see why I'd want a consistent way to set up and run an application, especially as it became more complicated.
But wait, what about hosting?
This was the part I'd been confusing from the beginning.
Hosting answers where my application runs and how people can reach it.
Docker helps with how my application and its dependencies are packaged and run.
They're not competing solutions.
I can run a Docker container on my own laptop. I can also run one on a cloud server. But simply putting an application inside a container doesn't mean it's suddenly available on the internet.
I'd still need a server or hosting environment, appropriate networking, and possibly a domain.
Docker doesn't replace all of that.
It just solves a different part of the problem.
So, did I misunderstand Docker completely?
Pretty much. At least initially.
I think what confused me was that Docker kept being introduced with a problem statement I didn't fully understand.
I knew what deployment was. I knew applications ran on servers. And I kept trying to fit Docker into that same explanation.
It wasn't until I separated making an application accessible from making an application run consistently that things started clicking.
And using it in an actual project helped much more than memorising definitions ever did.
I still have plenty to learn about Docker
But at least now, when someone says "It works on my machine," I know what problem they're actually talking about.
And no, the solution isn't necessarily to put the entire internet on my laptop.

