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

URL: https://antideploy.com/blog/your-app-built-successfully-but-never-started-listening-on-its-port

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.

**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'
```

## At a glance

- **What it means**: The app did not answer
- **Fix one**: Read PORT, listen on 0.0.0.0
- **Fix two**: Add the package the start command needs
- **Fix three**: Read what it printed before it exited

Published 7 October 2026. Facts checked 7 October 2026. 2 min read.

## 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.

## Start-up questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto: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](https://antideploy.com/blog/app-ran-out-of-memory-while-starting).

### Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [Why does my app work on localhost but not online?](https://antideploy.com/blog/why-does-my-app-work-on-localhost-but-not-online): Nine common reasons, how to check each one, and how to fix it.
- [Error: Cannot find module when the app starts](https://antideploy.com/blog/error-cannot-find-module-when-the-app-starts): The start command needs a package that was removed with the dev dependencies after the build.
- [Your app ran out of memory while starting up](https://antideploy.com/blog/app-ran-out-of-memory-while-starting): Each app has 1 GB, a Java app 2 GB. Loading a large model or dataset at startup can use it all. Load lazily.

- [Deployments](https://antideploy.com/platform/deployments)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)
- [Hosting](https://antideploy.com/platform/hosting)
- [Environment variables](https://antideploy.com/platform/environment-variables)

Facts on this page were checked against the live platform on 7 October 2026.

## 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.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
