Skip to main content

Cloud & deployment

Your App Works Locally. What Changes When You Take It to Production?

By Fatima Mustafa · Code Huddle · Product engineering guides

“It works on my machine.” Every developer has said it at some point. But your laptop is a very controlled environment. Production is not. Once real users start using your application, you are dealing with real data, real credentials, real networks, third-party services, security concerns, and failures you could never reproduce locally. The code may be the same. The environment around it is completely different. Here are the things you should check before moving an application from development to production.

1. Your environment is different

Locally, your application might look like this:

Frontend → localhost → Backend → Local Database

Everything is nearby and under your control.

In production, it may look more like:

User → Domain + HTTPS → Frontend → Backend → Database → Third-party services

Suddenly, things that were never a problem locally matter.

Your API URL changes. Your database is remote. Your frontend and backend may live on different services. Your environment variables are different. Your application now needs real domains, HTTPS, proper routing and production credentials.

For example, an API call that worked perfectly with http://localhost:4000/users might fail completely if the production frontend is still pointing to that address.

Before launch, check:

  • Are your production URLs correct?
  • Are your environment variables configured?
  • Is HTTPS working?
  • Can your frontend reach your backend?
  • Are your production credentials being used?

A production deployment should never depend on assumptions that were only true on your laptop.

2. Your database is no longer disposable

Testing with 20 sample records is very different from running an application with thousands of real records.

Production data can include:

  • Existing users
  • Historical records
  • Relationships between records
  • Uploaded files
  • Payment information
  • Data created by older versions of the application

That means database changes need more care.

A migration that works perfectly on a clean local database does not automatically mean it is safe for production.

A real lesson from production

On one project, a potentially destructive database operation made us think immediately about recovery.

Fortunately, an earlier backup was available.

The important lesson wasn't just “remember to back up.”

It was: Production safety means knowing how you would recover when something goes wrong.

Before launch, know what is being backed up, how often, where it is stored, and how you would restore it.

3. Your integrations behave differently

Third-party integrations are another common source of “works locally, breaks in production.”

You may be using:

  • Test Stripe credentials
  • Sandbox APIs
  • Development callback URLs
  • Mock responses
  • Local webhook endpoints

Production requires all of these to be connected to their real counterparts.

I've worked on applications that depended on services such as Stripe, Plaid, Airbnb and property-data APIs. The challenge was not simply making an API call.

Each integration had to work with the correct production credentials, endpoints, permissions and data flow.

And sometimes the biggest problem isn't your code at all.

Documentation can be incomplete. APIs can change. A provider can return an unexpected response.

In one integration, the documentation stopped short of answering what we needed to know, so the solution was to communicate directly with the external engineering team.

That is part of production engineering too.

Before launch, ask: What happens if the third-party service is unavailable?

Your application should not assume that an external API will always respond successfully.

4. Your network becomes part of the application

Locally, you rarely have to think about how traffic reaches your application.

Production is different.

You may now have:

  • A domain
  • DNS
  • HTTPS
  • A reverse proxy
  • Firewalls
  • Different ports
  • CORS rules
  • Separate frontend and backend servers

I experienced this firsthand while working with a self-hosted system running on a Windows Server with a static IP and local MongoDB.

Getting the application running was only one part of the work.

We also had to think about how users would actually reach it and how requests would move through the environment.

That's an important distinction: Deployment is not just putting your code on a server.

The infrastructure around your application is part of the product.

5. Production needs to handle failure

Local development usually follows the happy path: Request → Success → Done

Production looks more like: Request → Network → API → Database → External service → Maybe success, maybe timeout, maybe failure

Imagine a payment request.

The payment provider might successfully process the payment while your server times out before receiving the response.

What happens now? Should you retry? Could that create a duplicate payment? How will you confirm the final status?

The same problem appears with emails, webhooks, file uploads and other external services.

Production-ready systems need to answer questions like:

  • What happens when a request times out?
  • Can this operation be safely retried?
  • How do we avoid duplicate actions?
  • What does the user see when something is still processing?
  • How does the team know something failed?

Good production code is not code that assumes everything works.

It's code that knows what to do when it doesn't.

6. Security shortcuts need to disappear

Development often involves shortcuts.

You might have:

  • Test credentials
  • Open local databases
  • Detailed error messages
  • Permissive CORS
  • Debug logging
  • Hardcoded test accounts

These can be useful while developing.

They should not follow you into production.

Before launch, make sure:

  • Secrets are not committed to your repository
  • Production credentials are stored securely
  • Authentication is properly configured
  • Authorization is checked on the backend
  • Sensitive data is protected
  • Production errors do not expose internal details

One important rule: Hiding a button does not mean the action is secure.

If a user should not be allowed to perform an action, the backend must enforce that rule too.

7. A deployment is not the same as a launch

Your application building successfully does not mean it is ready for customers.

A production release should be something you can verify and, if necessary, recover from.

At minimum, make sure you have:

  • A repeatable deployment process
  • Application logs
  • Basic monitoring or error visibility
  • Database backups
  • A way to roll back or recover
  • A clear owner for production issues

CI/CD can make deployments much more reliable because the process becomes repeatable instead of depending on someone remembering every manual step.

But automation only answers: “Can we deploy this?”

You also need to answer: “How will we know it is working after deployment?”

8. A simple production checklist

Before launching, test the application as a real user.

Configuration

  • Production environment variables are correct
  • Real API keys and credentials are configured
  • No localhost URLs remain

Infrastructure

  • Domain works
  • HTTPS works
  • Frontend and backend communicate correctly
  • Routing and ports are configured

Database

  • Production schema is correct
  • Migrations have been tested
  • Backups exist
  • Recovery is understood

Integrations

  • Production API accounts are connected
  • Webhooks and callbacks work
  • Failure cases have been considered

Security

  • Secrets are protected
  • Authentication works
  • Authorization is enforced
  • Debug information is not exposed

Operations

  • Logs are available
  • Deployment is repeatable
  • Someone knows what to do if production fails

And don't stop at testing individual features.

Test a complete journey: Sign up → Log in → Create something → Use the main feature → Trigger an integration → Complete the workflow

That is much closer to what your real users will experience.

The real difference between local and production

The biggest change isn't where your code is running.

It's the number of things you can no longer assume.

Locally, you control the environment.

In production, you have to account for: real users, real data, real networks, real integrations and real failures.

That's why an application being “finished” and an application being production-ready are two different things.

Before you launch, ask one simple question: What was true on my laptop that might no longer be true for a real user?

That question catches more production problems than simply asking whether the build succeeded.