# How to deploy a Streamlit app.

URL: https://antideploy.com/blog/how-to-deploy-a-streamlit-app

Streamlit deploys with one sentence. Antideploy finds your entry file and starts it with the flags it needs behind a proxy.

## At a glance

- **Entry file found**: streamlit_app.py, app.py, main.py and more
- **Started for you**: With the port and proxy flags set
- **WebSockets stay open**: No time limit of our own
- **1 GB of memory**: Load big models lazily

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

## The short answer

To deploy a Streamlit app, give your coding agent the sentence below. Antideploy finds Streamlit in your requirements, finds the file that imports it, and starts it with the flags it needs behind a proxy. You do not set the port or write a start command. Each app has 1 GB of memory, so load large models when first needed rather than at startup.

> **Say this to your coding agent**
>
> Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.

## What Antideploy detects

- **Streamlit.** Detected from `streamlit` in `requirements.txt` or `pyproject.toml`. If a project also imports Flask, it is still treated as Streamlit.
- **The entry file.** It looks for `streamlit_app.py`, `app.py`, `dashboard.py`, `main.py` and `home.py`, in that order, in the folder of your requirements. The first one that contains `import streamlit` wins. Otherwise it uses any `.py` file that imports Streamlit.
- **The start command.** `streamlit run <entry> --server.port $PORT --server.address 0.0.0.0` with `--server.headless true`, `--server.enableCORS false` and `--server.enableXsrfProtection false`. Those flags are what make Streamlit work behind a proxy.
- **The port.** It starts the app with `PORT` set, and the start command passes it to Streamlit.

## What your project needs

**requirements.txt**

```
streamlit
pandas
```

Nothing else is required. You do not call a server from your code, and you do not change the port.

## WebSockets and sessions

Streamlit keeps a WebSocket open to every browser tab. Antideploy sets no time limit of its own on a connection, and each app is one long-running process, so sessions behave as they do on your own machine. An idle WebSocket to a Streamlit app stayed open for 330 seconds in our test on 19 September 2026, until we closed it.

## Memory

Every app gets 1 GB. A Streamlit app that loads a model or a large dataset when the script starts can run out of memory and be stopped before it listens. The deploy tells you when that happens. The usual fix is to load the data the first time it is needed, and cache it with `st.cache_resource`.

## Step by step

### 1. Check your requirements

`streamlit` is listed, and any model or dataset is loaded lazily.

### 2. Paste the sentence and approve one link

Your agent creates the app and builds it.

### 3. Deploy and open the link

Antideploy installs your requirements, starts Streamlit and checks that it answers. Your agent tells you the address.

## Secrets

Keep API keys out of your code and out of any file you commit. Use environment variables, and read them with `os.environ`. Values you save on Antideploy are encrypted and write-only.

## Here's where it stops.

A platform that only tells you what it is good at is one you find the edges of in production. These are the ones to know before your first deploy.

### Apps sleep when idle

On every plan, an app nobody is using goes to sleep and the next visit wakes it. The first request took 2.9 to 13.9 seconds in our measurements, depending on the stack. There are no always-on workers, so use a cron job or a webhook for background work.

### One instance, no previews

Each app is one instance with 1 shared vCPU and 1 GB of memory, and a Java app gets 1 dedicated vCPU and 2 GB. There are no preview deployments and no per-branch URLs.

### The disk forgets

Anything written to local disk is gone on the next deploy. Apps that speak S3 get a bucket instead.

## Streamlit questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto:support@antideploy.com)

### Why is the first load slow?

Apps sleep when idle. Measured on 19 September 2026, the first request after sleeping took 4.3 to 5.8 seconds for Streamlit, and the next request about 0.14 to 0.15 seconds.

### Why is my page blank after it loads?

Streamlit's checks can refuse the WebSocket behind a proxy. Antideploy sets the flags that prevent this. If you started Streamlit with your own start command, add them.

### Can I use a Dockerfile?

Yes. If there is a Dockerfile at the root, Antideploy uses it, and its own start command.

### Can I keep data between runs?

Use a database or a bucket. The app's disk is replaced on every deploy.

### What does it cost?

A Streamlit app counts as one live app. The Free plan includes 1 live app with a server.

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

- [How to deploy a Gradio app](https://antideploy.com/blog/how-to-deploy-a-gradio-app): Your entry file is found and run with python. Launch on 0.0.0.0 and PORT, and mind the 1 GB of memory.
- [How to deploy a FastAPI app with Postgres for free](https://antideploy.com/blog/how-to-deploy-a-fastapi-app-with-postgres-for-free): The uvicorn command, the port, DATABASE_URL, Alembic migrations and the Python version.
- [Your app built successfully but never started listening on its port](https://antideploy.com/blog/your-app-built-successfully-but-never-started-listening-on-its-port): The app built but never answered on its port. Read PORT, listen on 0.0.0.0 and check the logs.

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

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