# Expose an app

## What you need

A server from a template with the **Web app** launch mode, such as a language-model API or an image tool, with the status **Running**.

## Open the app

1. Open the server and select the **Connect** tab.
2. Under **App**, select **Open app**, or copy the **App address**.

The **Ports** table on the same tab lists the ports that are open on the server, with the server port and the public port and address for each. Ports that are not listed are not reachable from outside. If the app has a sign-in, the **Connect** tab shows how to sign in under **Sign in with**.

## If you run your own app

Your software must listen on all addresses, not only on localhost, and on a port the template exposes. For a quick test over SSH:

```bash
python -m http.server 8000 --bind 0.0.0.0
```

To expose other ports, make your own template with those ports. See [Templates](/docs/templates).

## Keep a port private

Use SSH forwarding. Replace `PORT` and `HOST` with the values on the **Connect** tab:

```bash
ssh -p PORT -L 8080:localhost:8000 root@HOST
```

Then open `http://localhost:8080` on your own computer.

## Protect your app

A public app is open to anyone who has the address. Add a login or an API key to your software. Do not expose databases, admin pages or notebooks without a password. You are responsible for what runs on your server, as set out in the [Acceptable Use Policy](/legal/acceptable-use).

## When the server stops

The app is not reachable while the server is stopped, and the address and ports can change when it starts again. Check the **Connect** tab after each start.
