From Localhost to Production: Why You Need Deployment Stages
What localhost and public mean, how to get from one to the other, and why you need separate environments (dev, test, demo, production) the moment you stop building alone.
When you build software, your code first runs only on your own machine. That private version is called localhost. To let anyone else use it, you put it on a server connected to the internet - that is the public version. This guide explains the journey from local to public, and the more important lesson underneath it: the moment you stop working alone, you need more than one environment. One broken change should never take down the only version you have.

Localhost versus public
Localhost is your computer talking to itself. When you run an app locally, it is available at an address like http://localhost:3000, and only you can open it. It is private, fast to change, and safe to break, because no one else depends on it.
Public means the app runs on a server that anyone on the internet can reach, at a real address like https://yourapp.com. Now other people load it, so it needs to be reliable, and a mistake is visible to everyone.
The whole craft of shipping software is moving an idea safely from the first kind to the second.
How you get from local to public
You do not copy your laptop to the internet. You deploy: you send your code to a hosting service that runs it on a server for you and gives it a public address. A platform like Railway takes your code, builds it, and runs it, so you do not manage servers by hand. AI build tools and the cloud have made this step take minutes instead of weeks.
What the stages are
A stage, or environment, is a separate running copy of your app. Each one has its own purpose. You do not need all of them on day one, but you should know what each is for.
- Development (dev) is where work happens. It is allowed to be broken at any moment, because that is where you try things.
- Test or staging is a copy that looks like production but is for you and your team. You deploy a change here first and check it before real people see it.
- Demo or business acceptance is a stable, presentable version. It does not change while you are mid-experiment. This is what you open in front of a customer.
- Production is the live version your users rely on. Changes only reach it after they pass the earlier stages.
The key idea is promotion: a change moves forward stage by stage only when it works. Each stage is a checkpoint that protects the next one.
When you actually need stages
If you are alone, exploring an idea that no one has seen, one environment is fine. Adding stages too early is busywork. The honest trigger is this: you need stages the moment someone else starts to depend on what you show.
That moment usually arrives sooner than people expect. It is not your first paying customer. It is the first time the idea is real enough to show, even to a single investor or partner. As soon as you want to show a demo, you need a stable place to show it from, separate from the place where you are still building. Once you have validated that the idea is worth building properly, a second environment stops being overhead and starts being insurance.
A real example of why this matters
Here is a situation that shows the cost of having only one environment.
A founder had a meeting booked with a customer she really wanted to win. A few days before the meeting, she decided to build a new feature that mattered to exactly this customer. She had talked about the idea but had not built it yet. She wanted to walk in with something to show.
She built it fast, in the one environment she had. During the meeting, she went to demo it - and broke that environment. The change did not work, and because it was her only copy, there was now nothing to show at all. Fixing it took another hour. By then the meeting was over.
With a second environment, this never happens. The new feature lives in dev or test. The customer sees the demo environment, which is stable and untouched by the experiment. If the experiment breaks, the demo still works. You promote the feature to demo only once it actually runs. The risk of “I broke the only thing I had right before the meeting” simply disappears.
Stages do not have to cost more
People avoid extra environments because they assume each one doubles the bill. With a serverless approach, that assumption is wrong.
The expensive part of an app is usually the stored data. You do not need to copy your storage for every stage. You can keep one real store and let the other stages read from it across accounts, so you are not paying to duplicate gigabytes of data. What you do duplicate is cheap: the pipelines and functions, the logic that runs only when called and costs almost nothing at rest. You build and test changes in the dev pipeline, and you promote the pipeline to the demo stage only when it works. The data stays in one place. The cost of a second stage is close to zero.
This is the practical version of “start simple”: you get the safety of separate stages without the bill of a full second copy.
It is fine to start simple and keep changing
Stages are not the only thing you should treat as flexible. The product itself should change with every release, especially early on.
- Change the look as you learn. It is completely fine to change the user interface, the colors, and the wording on every release. You are not committing to a final design. You are testing what works.
- Let measurements decide, not opinions. Use A/B testing , where you show two versions to different visitors and keep the one that performs better. Decisions come from real numbers, not from guessing.
- Test more than one audience at once. You can run the same core idea with a different look, a different explanation, and a different target group at the same time, then see which one attracts people. Check which version draws organic search traffic and which message lands.
- Iterate in public. Ship small, measure, and adjust. This is the lean startup loop applied to your environments: build a small thing, put it in front of people, learn, and repeat.
Separate stages are what make this safe. You can experiment hard in dev, A/B test in production, and never put the version a customer relies on at risk.
Which stage, and when
| When you have it | What it protects | Cost with serverless | |
|---|---|---|---|
| Dev (local) | Always, from day one | Nothing, it is meant to break | Free, on your machine |
| Test / staging | When a teammate or a demo depends on you | Stops broken changes reaching anyone | Low, share storage across stages |
| Demo / acceptance | The first time you show the idea to anyone | Keeps a stable version for meetings | Low, mostly just pipelines |
| Production | When real users rely on it | The live experience people trust | Pay for real usage only |
What’s next
- Working with multiple environments : the practical next step. How to promote one artifact, configure each stage, tag resources across clouds, and log without breaking GDPR.
- The Lean Startup on a Budget : how to build fast and cheap and let evidence guide every release.
- What is Bootstrapping? : funding and building a company without outside money.
Further reading
- Railway : a platform that takes local code to a public address without managing servers.
- Frontend vs Backend : the layers each environment runs.
- The Lean Startup on a Budget : the build, measure, learn loop for solo founders.
- Build, Measure, Learn : the experiment loop behind A/B testing and iteration.
- What is Bootstrapping? : keeping costs near zero while you validate.