BlogStart

Your app built successfully but never started listening on its port How to fix it.

Your app built, then never answered on its port. Read the PORT variable, listen on 0.0.0.0, and check what the app printed before it exited.

How the Agent API works
What you see
Your app built successfully but never started listening on port 3000.

We started it with: npm run start

Your app printed this before it exited:

  Error: Cannot find module 'express'
  • What it meansThe app did not answer
  • Fix oneRead PORT, listen on 0.0.0.0
  • Fix twoAdd the package the start command needs
  • Fix threeRead what it printed before it exited

What it means

The build worked. Antideploy then started your app and waited for it to answer on its port, and it never did. The message tells you the port, the command it ran, and, when it can, what the app printed before it stopped. This is the most common failure on Antideploy.

The three usual causes

  • The app listens on a fixed port, or on 127.0.0.1. The platform tells your app the port in the PORT environment variable, and the app must listen on 0.0.0.0.
  • The start command needs a package that is not in your dependencies. Development dependencies are removed from the image after the build.
  • The app crashed on boot. A missing config file, a missing environment variable, or a database query before the tables exist.

How to fix it

  1. Read what the app printed

    The message includes the last lines the app printed before it exited. They usually name the cause. Your agent can also read the app's logs.

  2. Read the port and listen on all addresses

    Use the PORT variable, and bind to 0.0.0.0.

    Node (Express)
    const port = process.env.PORT || 3000;
    app.listen(port, "0.0.0.0");
    
    # Python (Flask)
    import os
    app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))
    
    # Python (Gradio)
    demo.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))
  3. Check the start command

    The message shows the command that was run. If your project has no start script, add one, or add a Procfile with a web: line. A start command that needs a package must find it in dependencies.

  4. Deploy again

    Redeploying the same code unchanged fails the same way, so change something first. A failed deploy never counts against your plan.

Frameworks that are started for you

When Antideploy chooses the start command, FastAPI, Flask, Django and Streamlit already get the port and the address. If you wrote your own start command or a Procfile, yours is used instead. Gradio is started with plain python, so your code must pass them. A Go or Java app must listen on the port in PORT, which is 8080 for these languages.

01Questions

Start-up questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Why does it work locally?

Locally, your app can listen on any port and any address you can reach yourself. On a server, traffic arrives on the port the platform names, on any address.

What if the message says the app ran out of memory?

That is a different problem. See the app ran out of memory while starting.

Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.