DEV Community

From "Localhost" to "Production": 40 Traps Nobody Warns You About

Read this first

I am not a software engineer. I build tender responses for a living - spreadsheets, technical memos, cost models.

In autumn 2026 I decided to turn a personal life-management app I had been using alone into something other people could sign up for. I had the thing working on my laptop already. I thought the remaining work was "put it on the internet." That is the sentence this guide exists to disarm.

What follows is not a tutorial. There are thousands of tutorials and they all stop at the same place: the happy path, on your machine, with one user, with your own data, with no money involved.

This is a list of the specific walls I hit after that point, what each one cost me, and what I did. Every one of them is written down because I wrote a decision log as I went - 55 entries, each one recording why, what I gave up, and when to reopen it. That habit is chapter 13 and it is probably the most valuable thing in here.

Who this is for. You started an app with an AI assistant. It works locally. You are one person. You now want real users, and you are discovering that the gap is not code.

Who this is not for. Teams with a DevOps person. Anyone who has shipped production software before. You already know most of this and you paid for it the same way I did.

One honest warning. I will name tools and prices. Both change. Verify before you commit money. Where I am uncertain, I say so.

Chapter 1 - The hosting wall

Trap 1: your frontend's host will not run your backend

This is the first wall and it stops more solo projects than any bug. GitHub Pages, Cloudflare Pages, Netlify, Vercel's static tier - these serve files. They do not run a long-lived Python or Node process with a database connection.

Neither does shared web hosting from a domain registrar: mine sells "web hosting" and it will not execute Python at all. So the moment your app has a login, it needs somewhere fundamentally different from where your HTML lives. Budget for this before you design anything.

Trap 2: the free tiers are a minefield, and the map is out of date

I evaluated every free option I could find. What I actually found, in autumn 2026:

  • Koyeb - no longer offers free compute.
  • Fly.io - trial machines stopped after about five minutes.
  • Railway - after the trial, a credit of roughly one dollar a month. That is not a tier, it is a demo.
  • Google Cloud Run - works, sleeps, and is considerably more technical than the others. If you are learning infrastructure at the same time as shipping, this will eat your week.
  • Render free - sleeps after 15 minutes of inactivity, wakes in about a minute. Real, usable, free.

Every blog post I read recommending one of these was written before the tier changed. Check the pricing page yourself, today. Mine is already out of date as you read this.

Trap 3: "free tier" and "real users" are incompatible, and that is fine

I chose Render's free tier knowingly. A 15-minute sleep and a one-minute cold start is unacceptable for a paying customer and perfectly acceptable for showing the app to five people who agreed to look at it.

The decision I wrote down was: free tier until the paid launch, then a small always-on VPS in a European datacenter (around €6-12/month depending on commitment length). Two phases, two different sets of requirements, one deliberate downgrade in between.

The mistake to avoid is the opposite: paying for always-on infrastructure for eight weeks while you have zero users, because it feels more professional.

Trap 4: your host can simply be unavailable

Mid-project my platform went into an extended maintenance window. My app's address stopped answering for over a week. Nothing was broken. There was nothing to debug.

This is worth internalising because the first instinct - mine, for about an hour - is to assume you broke it. Before you touch anything: check the provider's status page. If your domain resolves and your app doesn't answer and you changed nothing, it is probably not you.

It also means do not schedule a launch demo on infrastructure with no SLA.

Chapter 2 - Deploying, and what actually happens

Trap 5: "Live" does not mean live

The single most useful four minutes of my project. My platform's dashboard said the deploy was Live. I opened the URL. It returned Not Found.

I spent a while hunting through my routing before realising the response was coming from the platform's edge, not from my application - the deploy had succeeded and the public address simply had not propagated yet. It cleared on its own after about four minutes.

Rule: after a first deploy, wait five minutes before you conclude anything. And learn to tell your app's 404 from your platform's 404 - they look different. Mine returns JSON; the platform returns an HTML page. Knowing which one you are looking at saves hours.

Trap 6: one image, one Dockerfile, no exceptions

I was tempted into a second Dockerfile for local development. Resist it. The two drift, and then you are debugging a difference between environments instead of a bug.

I ship a single Dockerfile, with the build context one level up so it can pull in the API, the user-facing frontend, and the static public pages together. Local compose uses the same file. Production-only settings are baked in as environment variables, not as a separate build.

Trap 7: run your migrations on container start

Put alembic upgrade head (or your equivalent) in the container's start command. The payoff is large and immediate: deploying new tables becomes a git push.

I added five tables for a shared-household feature and did nothing else - the migration ran at boot on the new container. For a solo builder with no deploy pipeline, this removes an entire category of "I forgot to migrate production."

The caveat: a failed migration now means a container that won't start. Test migrations locally against a real database, not just SQLite.

Trap 8: secrets must never be in the repo, and you must say so out loud

Mine are declared in the deploy manifest as "do not sync" - the manifest names the variable, the platform holds the value, the repo holds nothing. The database URL, the owner's email, every API key.

Two things that bit me anyway:

  • My .dockerignore initially did not exclude .env. The file was being baked into the image. Check this explicitly: docker build then inspect the image's filesystem.
  • My test suite read the local .env file and six tests passed on my machine for reasons that had nothing to do with the code. Tests must ignore your local environment file.

Chapter 3 - The caching traps

These cost me more wall-clock hours than any genuine bug, because each one makes you believe a change didn't work.

Trap 9: the browser is serving you yesterday's JavaScript

You edit a file. You reload. Nothing changes. You conclude the change is wrong. You "fix" the working code.

Chrome caches JavaScript aggressively. After editing a script, force-reload (Cmd+Shift+R / Ctrl+Shift+R). I lost an afternoon to this before it became reflex, and I still catch myself.

If you are automating a browser to test your own app, this is worse - your automation reads the stale file and reports a failure that does not exist.

Trap 10: your free-tier host is revalidating 70 files on every page load

My app took about eight seconds to open. The cause was not the server being slow. It was roughly seventy conditional requests per page load, each one a round trip to a free-tier instance, just to be told "not modified."

The fix is boring and enormous:

  • Serve versioned asset URLs (style.css?v=7) with a long, immutable cache: private, max-age=604800, immutable. No revalidation for a week.
  • Serve the HTML with no-cache.

Because the HTML is never cached and it contains the version numbers, shipping a new version changes the asset URLs, and the browser fetches exactly the files that changed and nothing else. Eight seconds became well under one.

Trap 11: a server process does not reload itself

Obvious written down, invisible at 2am: editing a Python file that is already running changes nothing until the process restarts. I made a dedicated one-click restart script purely so I would stop forgetting.

Chapter 4 - Going multi-user

Trap 12: every row needs an owner, and you must test that it does

This is the whole job of becoming multi-user, and it is not glamorous. Every single piece of stored data gets a user_id. Every query filters on it.

And then - this is the part people skip - you write a test that proves account A cannot read account B's data. Not a manual check. An automated test that fails your build. I treat isolation tests exactly like any other test. A regression in data isolation breaks the build the same way a syntax error does. If that sounds dramatic: the alternative is finding out from a user.

Trap 13: do not rewrite. Wrap.

I had around seventy working screens built for one person. Rewriting them properly would have taken months. So I didn't. I wrote a clean, tested core - accounts, sessions, the shell - and ran the existing screens inside a compatibility layer: the old code still calls the same storage interface it always did, but that interface now talks to a per-account API instead of the browser's local storage. The old screens do not know they are multi-user.

The reasoning I wrote down at the time, and still believe: Nothing sells faster than something that already works. The main risk to this project is not technical debt - it is never launching.

The deliberate cost: the debt is real, and it is localised. Old code lives in one clearly-marked directory. The core is clean. A screen gets properly rewritten when actual usage justifies it, not because it offends me.

Trap 14: pick the boundary between shared and private data, not shared and private features

I needed one module - the household one: shopping list, meal plan, shared calendar - visible to two accounts, while everything else (money, health, wardrobe) stayed private. My first instinct was to make the module shared. That's a rewrite.

What actually worked: all my data was already key-value, owned by an account. So I made a single whitelist of 27 keys that are owned by the household instead of the account. One file. A module that wants to share a piece of data adds its key there and nowhere else.

Then the only real work was in one place - the storage service:

  • reading merges account keys and household keys, with household winning on collisions;
  • writing routes each key to the right table based on the whitelist;
  • the version counter returns the sum of both counters, so it still only ever increases.

That last point is the whole trick. My frontend already polled a version number every 25 seconds to detect changes from my other devices. Because the household counter is included in the sum, a change made by the other person moves the version, and the existing sync mechanism picks it up. I added real-time collaboration between two users without touching the sync code at all.

And the property I cared most about: an account with no household reads and writes exactly as before. No regression is possible for solo users.

Trap 15: the shared calendar is not the private calendar

I nearly shared my calendar key wholesale. It contains personal appointments and everything synced from a work calendar. Shared data needs its own key, with an explicit "this is shared" flag on each item.

And then you discover your codebase touches that calendar in sixteen different places. I funnelled all sixteen through a single accessor that files each event into the right list based on its flag. Sixteen call sites is a refactor; sixteen call sites each deciding privacy independently is a leak waiting to happen.

Trap 16: joining versus creating must behave differently, and the user must be told

Two cases, two behaviours:

  1. Creating a household moves your existing lists into it. Nothing lost, nothing duplicated.
  2. Joining someone else's household sets aside your own versions of those lists. Theirs become authoritative.

The second one destroys data from the user's point of view. Say so, in plain language, before they confirm. Not in a tooltip.

Trap 17: invitations are secrets, and must behave like secrets

My invitation tokens: random, prefixed so they are recognisable in logs, only the SHA-256 hash is stored, valid 14 days, single-use, and locked to the invited email address - someone who intercepts the link cannot redeem it from another account. Only the owner can invite, cancel, or remove. An account belongs to exactly one household.

Each of those constraints came from asking "what happens if this link ends up in a group chat."

Chapter 5 - Scrubbing your own life out of your app

This chapter is specific to the path I took - personal tool first, product second - and it is the one I have found written down nowhere.

Trap 18: your personal data is woven through the code, not stored neatly beside it

I made a copy of my app to serve to other people and started removing myself from it. I expected a database cleanup. What I found was my name, my city, my bank, my employer, file paths from my laptop, password hashes, phone numbers and email addresses scattered through source files, often as defaults that looked innocent.

Trap 19: so write a test that sweeps every served file

This is the single best idea in this guide and it took twenty minutes to build. An automated test walks every file the server will send to a browser and fails the build if it finds:

  • any of a list of personal names, place names,
  • 64-character hex strings (password hashes and keys),
  • anything shaped like an email address,
  • anything shaped like a phone number,
  • or an absolute path from my machine.

It has caught things I would never have found by reading. And it keeps catching them - every time I port a feature over from my personal version, the test is standing there.

Trap 20: neutralising by hand creates a worse bug - duplicated truth

Here is how it goes wro

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.