> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.astropods.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.astropods.com/_mcp/server.

# Custom app

With `frontend: true`, the platform gives your agent a dedicated HTTPS hostname and sends that traffic straight to your container. Your server decides what to serve: a dashboard, a single-page app, or a server-rendered site.

**`astropods.yml`**

```yaml title="astropods.yml"
agent:
  build:
    context: .
    dockerfile: Dockerfile
  interfaces:
    frontend: true
```

Once you set `interfaces`, `messaging` defaults to `false`. Set `messaging: true` too to keep [web chat](/web-chat) and [Slack](/slack).

## Serve on port 80

The deployed container must listen on port `80`, or it restarts in a loop. [Blueprint Spec](/astropods-package-spec) validation rule 15 enforces the port. Read the port from `PORT` with `80` as the fallback, so the same code also runs locally:

#### Node.js

**`server.js`**

```javascript title="server.js"
import express from "express";

const app = express();
app.get("/", (_req, res) => res.send("<h1>Hello from my agent</h1>"));
app.listen(process.env.PORT || 80, "0.0.0.0");
```

#### Python

**`main.py`**

```python title="main.py"
import os
import uvicorn
from fastapi import FastAPI
from fastapi.responses import HTMLResponse

app = FastAPI()

@app.get("/", response_class=HTMLResponse)
def root():
    return "<h1>Hello from my agent</h1>"

uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 80)))
```

## Sign-in and authorization

Visitors sign in to Astropods before any request reaches your container, and the platform forwards the signed-in user's identity to your agent. The platform requires sign-in, but your server decides what each user may do.

* On Node or Python, the adapter-core auth middleware checks each caller against the agent's access list: see Authorizing requests for [Node](/adapters/node/auth) or [Python](/adapters/python/auth).
* In another language, see [Manually authorize requests](/manual-authz).

## Who can open the app

#### Web app

Set access in **Interface access** on the deploy page, or later on the agent's **Configuration** > **Access** page.

#### CLI

```bash
ast agent access set --name my-agent --custom org=acme
```

Changes take effect within a minute, without a redeploy.

To open the app with no sign-in, set `public: { custom: true }` in the [deploy file](/deploy-spec#31-public). See [Access control](/access-control).

## Open the app

**Launch**, on the agent's card and its page, opens your hostname in a new tab. When the agent also has web chat, the arrow beside **Launch** picks **Custom app** or **Chat**. **Launch** works only while the agent is active.

## Run it locally

`ast project start` serves the app at `http://localhost:3200`. The CLI sends that traffic to container port `80`, and sets `PORT` to match. If your dev server listens on another port, set it in `dev`:

**`astropods.yml`**

```yaml title="astropods.yml"
dev:
  interfaces:
    frontend:
      port: 3000
```

The CLI then sends traffic to port `3000` and sets `PORT=3000`. This only changes local runs, so the deployed container must still listen on `80`. See [Run your agent locally](/run-locally).

## Next steps

* [Connect to OAuth-protected MCP servers](/mcp-oauth): add OAuth flows to a custom app
* [Access control](/access-control): decide who can open the app
* [Web chat](/web-chat): add chat beside the app