> ## Documentation Index
> Fetch the complete documentation index at: https://aeros-c1d071c8.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Domains and remote access

> Map domains to projects with Caddy, and see Tailscale and Cloudflare Tunnel status without background agents.

AerosPanel does not ship a reverse proxy or a VPN. It detects tools you already run and works with them. Every check runs when you open **SERVER\_INFO** or the domain dialog. Results are cached for 30 seconds, and nothing runs in the background.

![Server info page](https://mintcdn.com/aeros-c1d071c8/8fuJs39e8BgaLs5j/server-info.png?fit=max\&auto=format\&n=8fuJs39e8BgaLs5j\&q=85\&s=c7876d2deee7eaa3d9f883b65e9f2c00)

SERVER\_INFO with the REMOTE\_ACCESS (PASSIVE\_SCAN) panel.

## Caddy domains and HTTPS

If Caddy is installed and `caddy.service` is active, each project gets a **Configure Caddy Domain + HTTPS** button. It maps a domain to a local port, and Caddy obtains the TLS certificate.

### Prerequisites

**1. Install Caddy**

Install Caddy from its official Debian/Ubuntu repository and make sure `systemctl is-active caddy` prints `active`.

**2. Import the snippet directory**

AerosPanel writes one file per project to `/etc/caddy/conf.d/`. Caddy does not read that directory on its own. Add this line to `/etc/caddy/Caddyfile` once:

```caddy /etc/caddy/Caddyfile theme={null}
import /etc/caddy/conf.d/*.caddy
```

Then run `sudo systemctl reload caddy`.

**3. Point DNS at the host**

Create an `A` or `AAAA` record for the domain that points to the machine, and open ports 80 and 443 so Caddy can complete the ACME challenge.

### Map a domain

In the project toolbar, open **Configure Caddy Domain + HTTPS**, enter **DOMAIN (FQDN)** and **LOCAL\_PORT**, and save. The panel:

1. Validates the domain as a lowercase FQDN (for example `app.example.com`) and the port as 1 to 65535.
2. Writes `/etc/caddy/conf.d/aeros-<service_name>.caddy`.
3. Runs `systemctl reload caddy`.

```caddy /etc/caddy/conf.d/aeros-discord-bot.caddy theme={null}
# Managed by AerosPanel
app.example.com {
    reverse_proxy 127.0.0.1:3001
}
```

Your app only has to listen on `127.0.0.1:<port>`. Removing the domain deletes the snippet and reloads Caddy. Deleting the project does the same.

> [!WARNING]
>
> If Caddy is installed but not active, saving a domain fails with `Caddy service is not active on this host.` The panel never starts Caddy for you.

### Put the panel behind Caddy

The panel is not a project, so map it by hand:

```caddy /etc/caddy/Caddyfile theme={null}
panel.example.com {
    reverse_proxy 127.0.0.1:3000
}
```

The panel trusts `X-Forwarded-*` headers only from loopback, so a proxy on the same host is detected correctly. Over HTTPS, the session cookie gets the `Secure` flag. See [Security](https://aeros-c1d071c8.mintlify.site/security.md#reverse-proxies).

## Tailscale

AerosPanel runs `tailscale status --json` (1.5 second timeout) and shows:

* Whether Tailscale is installed and connected (`BackendState` is `Running`).
* The node's Tailscale IPv4 address and MagicDNS name.
* A panel URL, `http://<magicdns-name-or-ip>:<panel-port>`.

If the CLI is missing or fails but a `tailscale*` or `utun*` interface has a `100.x.x.x` address, the panel uses that address instead.

The installer also prints the Tailscale URL at the end when `tailscale` is present. Tailscale is the simplest way to reach the panel from outside your LAN without exposing it to the internet.

## Cloudflare Tunnel

AerosPanel checks for the `cloudflared` binary and whether `cloudflared.service` is active. It then reads the first of these files that exists:

* `/etc/cloudflared/config.yml`
* `/etc/cloudflared/config.yaml`
* `/root/.cloudflared/config.yml`

It lists every `hostname:` from the ingress rules. If a rule points to the panel's port, that hostname is shown as the panel URL. Otherwise, the first hostname is used.

```yaml /etc/cloudflared/config.yml theme={null}
tunnel: <tunnel-id>
credentials-file: /etc/cloudflared/<tunnel-id>.json
ingress:
  - hostname: panel.example.com
    service: http://localhost:3000
  - service: http_status:404
```

> [!NOTE]
>
> Same-origin checks compare the browser's `Origin` with the request's `Host` or `X-Forwarded-Host`. If the tunnel forwards the public hostname (the default unless you set `httpHostHeader`), you do not need `CORS_ORIGIN`. If you rewrite the host header, add the public origin to `CORS_ORIGIN` in `backend/.env`.

The panel never starts, stops, or configures Tailscale or `cloudflared`. Both names are on the reserved list, so they cannot be controlled as projects.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.