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

# Services and templates

> Create native systemd services from templates, with memory and CPU limits and an optional Linux user.

Every project in AerosPanel is a native `systemd` service. The panel writes a unit file to `/etc/systemd/system/<service_name>.service`, runs `systemctl daemon-reload`, and controls it with `systemctl start`, `stop`, `restart`, `enable`, and `disable`. Nothing runs in a container.

![Projects list](https://mintcdn.com/aeros-c1d071c8/8fuJs39e8BgaLs5j/projects-list.png?fit=max\&auto=format\&n=8fuJs39e8BgaLs5j\&q=85\&s=12c37092ff0cc4fbca8d58a235839ba3)

Projects page with service status, RAM, and CPU time.

## Templates

Pick a template in **Projects > New project**. It fills in defaults that you can edit before you save.

| Template | Default `ExecStart` | Default build command | Default `MemoryMax=` |
| :- | :- | :- | :- |
| Node.js / TypeScript | `/usr/bin/node dist/index.js` | `npm run build` | `256M` |
| Python (FastAPI / Bot) | `{{WORK_DIR}}/.venv/bin/python main.py` | none | `256M` |
| Static / Vite | `/usr/bin/python3 -m http.server 8080 --directory dist` | `npm run build` | `128M` |
| Java / Minecraft | `/usr/bin/java -Xms512M -Xmx1G -jar server.jar nogui` | none | `1536M` |
| Custom Command | `/usr/bin/env bash start.sh` | none | `512M` |

> [accordion] Node.js / TypeScript
>
> For Discord bots, Express or Fastify APIs, and TypeScript services. Use `/usr/bin/node index.js` for plain JavaScript projects without a build step.

> [accordion] Python (FastAPI / Bot)
>
> For discord.py or Telegram bots, FastAPI, or Flask apps with a local virtualenv in `.venv`. `{{WORK_DIR}}` is replaced with the working directory. For FastAPI, use `{{WORK_DIR}}/.venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000`.

> [accordion] Static / Vite
>
> Builds a Vite, React, or Astro site and serves `dist/` with Python's built-in HTTP server. Swap `ExecStart` for Caddy or another static server if you prefer.

> [accordion] Java / Minecraft
>
> For Paper, Fabric, or Purpur servers and Spring Boot JARs. Keep `MemoryMax=` above `-Xmx` so JVM overhead does not trigger OOM kills.

> [accordion] Custom Command
>
> For Go or Rust binaries, Bun apps, or any Linux executable. Give an absolute path and arguments.

## Project fields

| Field | Rule |
| :- | :- |
| Name | Required. Used in the unit `Description=`. |
| Service name | 1 to 64 characters: letters, digits, `.`, `_`, `-`. Must start with a letter or digit. Reserved names are rejected. |
| Working directory | Absolute path. Defaults to `/opt/<service_name>`. System directories are rejected. |
| `ExecStart` | Required. `./` and `.venv/` prefixes are made absolute against the working directory. |
| Linux user | Optional. Adds `User=`. Must match `^[a-z_][a-z0-9_-]{0,31}$`. |
| `MemoryMax=` | Optional. A number with an optional `K`, `M`, or `G` suffix, such as `256M` or `1G`. |
| `CPUQuota=` | Optional. A percentage from `1%` to `6400%`. |
| Repository and branch | Optional. Used by [Deploy](https://aeros-c1d071c8.mintlify.site/deploy-and-rollback.md). |
| Build command | Optional. Defaults to the template's build command. |

**PREVIEW\_.service** shows the unit before you save. It calls `POST /api/templates/preview`, which validates the same fields without writing anything.

The checkbox **Write /etc/systemd/system/\<service>.service and reload systemd** is on by default. Turn it off to register a project for a unit you manage yourself.

## Starter presets

The new project form also has presets for common self-hosted apps. They fill in the fields only. Install the binary yourself first.

| Preset | `ExecStart` | `MemoryMax=` | `CPUQuota=` |
| :- | :- | :- | :- |
| n8n | `/usr/bin/env n8n start` (global `n8n` from npm) | `512M` | `150%` |
| qBittorrent-nox | `/usr/bin/qbittorrent-nox --webui-port=8080` | `256M` | `100%` |
| Filebrowser | `/usr/local/bin/filebrowser -a 0.0.0.0 -p 8085 -r /srv` | `128M` | `100%` |
| Syncthing | `/usr/bin/syncthing serve --no-browser --gui-address=0.0.0.0:8384` | `256M` | `100%` |

## Generated unit

A Node.js project named `Discord Bot` with service name `discord-bot`, `MemoryMax=256M`, and `User=bot` produces:

```ini /etc/systemd/system/discord-bot.service theme={null}
[Unit]
Description=AerosPanel Service: Discord Bot
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=/opt/discord-bot
EnvironmentFile=-/opt/discord-bot/.env
ExecStart=/usr/bin/node dist/index.js
Restart=always
RestartSec=5
User=bot
MemoryMax=256M
StandardOutput=journal
StandardError=journal
SyslogIdentifier=discord-bot

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

`EnvironmentFile=-` loads `<work_dir>/.env` when it exists. Edit that file from the [.env editor](https://aeros-c1d071c8.mintlify.site/env-editor.md).

> [!TIP]
>
> Set `User=` to a dedicated unprivileged account. Without it, the service runs as root, like the panel. Create the user first, for example with `sudo useradd --system --home /opt/discord-bot bot`, and make sure it can read the working directory.

## Reserved service names

The panel refuses to create or control these units:

`aeros-panel`, `ssh`, `sshd`, `systemd`, `tailscaled`, `cloudflared`, `docker`, `ufw`, `cron`, `dbus`, and any name starting with `systemd-`.

## Blocked working directories

The working directory cannot be `/` or sit under `/etc`, `/bin`, `/sbin`, `/usr`, `/lib`, `/lib64`, `/boot`, `/dev`, `/proc`, `/sys`, `/run`, or `/var/lib`. Paths are normalized first, so `/opt/app/../../etc` is rejected too.

## Controls

Select a project to open its terminal and toolbar:

* **Start**, **Stop**, and **Restart**: `systemctl start|stop|restart <service>`.
* **Toggle Boot Autostart**: `systemctl enable|disable <service>`, so the service starts at boot.
* **Terminal**: while a project is selected, a WebSocket runs `journalctl -u <service> -f -n 100` and streams its output. Deploy and rollback output appears in the same terminal. The `journalctl` process is killed when the socket closes.

![Project terminal](https://mintcdn.com/aeros-c1d071c8/8fuJs39e8BgaLs5j/projects-terminal.png?fit=max\&auto=format\&n=8fuJs39e8BgaLs5j\&q=85\&s=449ed77053e58f8264d72749da291486)

Live journal output in the project terminal.

To delete a project, call [`DELETE /api/projects/:id`](https://aeros-c1d071c8.mintlify.site/api/endpoints#projects). Add `?removeUnit=1` to also stop, disable, and delete its unit file. Its Caddy route and failure alert drop-in are removed in both cases.

## RAM and CPU metrics

When `GET /api/projects` runs, AerosPanel reads each unit's counters with one call:

```bash theme={null}
systemctl show --property=ActiveState,MemoryCurrent,CPUUsageNSec -- <service>
```

* **RAM** is `MemoryCurrent`, the cgroup memory of the service in bytes.
* **CPU** is `CPUUsageNSec`, the total CPU time used since the service started, in nanoseconds. It is a running total, not a percentage.

Both are `null` when the service is not active or when `systemd` does not report them (for example, if memory or CPU accounting is off). Nothing is sampled in the background. The numbers are read only when the Projects page loads or refreshes.


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