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

# Installation

> Install AerosPanel as a single systemd service on Debian or Ubuntu with one command.

## Requirements

* Debian or Ubuntu with `apt-get` and `systemd`.
* Root access (`sudo`).
* Node.js 20 or newer. If Node is missing or older than 20, the installer adds Node.js 22 LTS from NodeSource.

## Install

> [tab] One command
>
> ```bash theme={null}
> curl -fsSL https://raw.githubusercontent.com/DevModee/Aeros-Panel/main/scripts/install.sh | sudo bash
> ```

> [tab] From a local clone
>
> ```bash theme={null}
> git clone https://github.com/DevModee/Aeros-Panel.git
> cd Aeros-Panel
> sudo ./scripts/install.sh
> ```

At the end, the installer prints the panel URL (LAN IP, plus the Tailscale IP when `tailscale` is present), the admin username, and a random initial password.

> [!WARNING]
>
> The initial password is printed once. Only its `scrypt` hash is stored in SQLite. Save it before you close the terminal, or reset it later with `seed.js`.

## What the installer does

**1. Checks the host**

Exits unless it runs as root on a host with `systemctl` and `apt-get`.

**2. Installs prerequisites**

Installs `curl`, `git`, `ca-certificates`, `gnupg`, `build-essential`, and `python3`. Installs Node.js 22 LTS through NodeSource if Node is missing or older than 20.

**3. Clones or updates the repository**

Clones `AEROS_BRANCH` into `AEROS_DIR`. If a Git checkout already exists there, it runs `git fetch`, `git checkout`, and `git pull --ff-only` instead.

**4. Builds the frontend and backend**

Runs `npm ci` and `npm run build` in `frontend/`, then deletes `frontend/node_modules` (unless `AEROS_CLEAN_FRONTEND_MODULES=0`). Builds the backend and prunes dev dependencies with `npm prune --omit=dev`.

**5. Writes the backend environment file**

Creates `backend/.env` with `NODE_ENV=production`, `PORT`, and `HOST=0.0.0.0`, mode `0600`. An existing file is left alone.

**6. Seeds the admin account**

On first install only, generates a random password, runs `backend/dist/seed.js`, and sets `aeros.db` to mode `0600`. An existing database is preserved.

**7. Installs the systemd unit**

Writes `/etc/systemd/system/aeros-panel.service` with `Restart=always` and `MemoryMax=${AEROS_MEMORY_MAX}`, then enables and restarts it.

**8. Caps journald disk use**

If no `SystemMaxUse=` or `RuntimeMaxUse=` is configured yet, writes a journald drop-in. See [journald limits](#journald-limits).

## Environment variables

All variables are optional. Pass them through `sudo -E` or set them inline:

```bash theme={null}
AEROS_PORT=8080 AEROS_DIR=/opt/aeros-panel AEROS_MEMORY_MAX=256M AEROS_JOURNALD_LIMITS=1 sudo -E ./scripts/install.sh
```

| Variable | Default | Purpose |
| :- | :- | :- |
| `AEROS_PORT` | `3000` | Port written to `backend/.env` as `PORT`. |
| `AEROS_DIR` | `/opt/aeros-panel` | Install directory. |
| `AEROS_MEMORY_MAX` | `256M` | `MemoryMax=` for `aeros-panel.service`. |
| `AEROS_JOURNALD_LIMITS` | `1` | Set to `0` to skip the journald drop-in. |
| `AEROS_REPO` | `https://github.com/DevModee/Aeros-Panel.git` | Repository to clone. |
| `AEROS_BRANCH` | `main` | Branch to clone or update. |
| `AEROS_ADMIN_USER` | `admin` | Username for the seeded admin account. |
| `AEROS_CLEAN_FRONTEND_MODULES` | `1` | Set to `0` to keep `frontend/node_modules` after the build. |

> [!NOTE]
>
> `AEROS_PORT` only applies when `backend/.env` does not exist yet. To change the port later, edit `PORT` in `/opt/aeros-panel/backend/.env` and run `sudo systemctl restart aeros-panel`.

## The generated unit

```ini /etc/systemd/system/aeros-panel.service theme={null}
[Unit]
Description=AerosPanel - Zero-Overhead Native Control Panel
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=/opt/aeros-panel/backend
EnvironmentFile=-/opt/aeros-panel/backend/.env
Environment=NODE_ENV=production
ExecStart=/usr/bin/node /opt/aeros-panel/backend/dist/index.js
Restart=always
RestartSec=5
MemoryMax=256M
StandardOutput=journal
StandardError=journal
SyslogIdentifier=aeros-panel

[Install]
WantedBy=multi-user.target
```

The service runs as root because it writes units to `/etc/systemd/system` and calls `systemctl`. The `ExecStart` path is whatever `command -v node` returned during install.

## journald limits

When `AEROS_JOURNALD_LIMITS=1` (the default) and no journald size cap exists yet, the installer writes:

```ini /etc/systemd/journald.conf.d/aeros-limits.conf theme={null}
[Journal]
SystemMaxUse=64M
RuntimeMaxUse=32M
```

It then restarts `systemd-journald`. If `SystemMaxUse=` or `RuntimeMaxUse=` is already set in `/etc/systemd/journald.conf` or any file in `/etc/systemd/journald.conf.d/`, nothing is changed.

## Updating

Run the installer again. It pulls the configured branch with `--ff-only`, rebuilds both parts, rewrites the unit, and restarts the service. Your `backend/.env` and `aeros.db` are kept.

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/DevModee/Aeros-Panel/main/scripts/install.sh | sudo bash
```

## Reset the admin password

From an SSH session on the host:

```bash theme={null}
sudo node /opt/aeros-panel/backend/dist/seed.js admin your-new-password
```

`seed.js` takes a username and a password of at least 10 characters. If the user exists, its password is replaced and all of its sessions are deleted. If it does not exist, the user is created. Usernames must be 3 to 32 letters, numbers, `_`, or `-`.

## First visit without a seeded user

If the database has no users (for example, when you run the backend by hand without `seed.js`), the first visit to the panel opens an **Initial Admin Setup** screen. It backs `POST /api/auth/setup`, which works only while no user exists.

## Uninstall

```bash theme={null}
sudo systemctl disable --now aeros-panel
sudo rm /etc/systemd/system/aeros-panel.service
sudo systemctl daemon-reload
sudo rm -rf /opt/aeros-panel
```

Units created for your projects, backups, and alerts are separate files in `/etc/systemd/system`. Remove them from the panel before you uninstall, or delete them by hand.


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