# All-in-one image

> Run FeatherPanel as a single container with the featherpanel-oci image. MariaDB, Redis, backend, frontend, async runner and cron in one image with one data volume.

Source: https://featherpanel.com/docs/panel/installation/all-in-one/

The `featherpanel-oci` image packs MariaDB, Redis, the PHP backend, the Next.js frontend, the async runner and cron
into one container, managed by supervisord. Use it when a platform can only run a single container. Otherwise prefer
the [Docker Compose install](https://featherpanel.com/docs/panel/installation/docker).

Release builds are published for `linux/amd64` and `linux/arm64` as `ghcr.io/mythicalltd/featherpanel-oci`, tagged with
the version and `latest`.

## Run it

```bash
docker run -d --name featherpanel \
  -p 80:80 \
  -v featherpanel_data:/home/container/data \
  -e FEATHERPANEL_ADMIN_EMAIL=admin@example.com \
  -e FEATHERPANEL_ADMIN_USERNAME=admin \
  -e FEATHERPANEL_ADMIN_PASSWORD='choose-a-strong-password' \
  --restart unless-stopped \
  ghcr.io/mythicalltd/featherpanel-oci:latest
```

The first start initialises MariaDB, writes `config/.env` with a new database encryption key and runs migrations. The
health check calls `/api/system/health`. Put a reverse proxy with TLS in front, see [Web server](https://featherpanel.com/docs/panel/web-server).

> [!WARNING]
> `config/.env` in the data volume holds `DATABASE_ENCRYPTION_KEY`. Losing it makes encrypted data unreadable. Back up
> the whole volume.

## Environment variables

| Variable | Default | Notes |
| --- | --- | --- |
| `DATABASE_DATABASE`, `DATABASE_USER`, `DATABASE_PASSWORD` | from the image | Used for the bundled MariaDB and written to `.env` on first start. |
| `REDIS_PASSWORD` | from the image | Password of the bundled Redis. |
| `MARIADB_ROOT_PASSWORD` | from the image | Root password of the bundled MariaDB. |
| `FEATHERPANEL_ADMIN_EMAIL`, `FEATHERPANEL_ADMIN_USERNAME`, `FEATHERPANEL_ADMIN_PASSWORD` | empty password | First admin, created only when a password is set and no users exist. |
| `ENABLE_MARIADB`, `ENABLE_REDIS`, `ENABLE_BACKEND`, `ENABLE_FRONTEND`, `ENABLE_ASYNC_RUNNER`, `ENABLE_CRON` | `true` | Set to `false` to skip a service. |
| `FRANKENPHP_WORKER` | `true` | FrankenPHP worker mode for `/api/*`. `false` uses classic mode. |
| `FEATHERPANEL_APP_URL` | empty | Shown in the container's login banner. |

Set the passwords before the first start. The database user is created on the first start and keeps that password.

## Data volume

| Path in `/home/container/data` | Content |
| --- | --- |
| `mysql`, `redis` | Database and cache files |
| `config` | `.env` |
| `attachments`, `uploads`, `translations`, `addons`, `pma` | Attachments, uploads, translations, plugins and phpMyAdmin |
| `logs`, `backups` | Panel logs and backups |

Plugin symlinks are rebuilt on every start, so plugins survive image updates.

## Running as a game server

The image also starts as a non-root user, for example as a server on a [FeatherWings](https://featherpanel.com/docs/wings) node. In that mode
MariaDB and Redis run as the current user and cron is turned off.

## Commands

`featherpanel` inside the container runs the [panel CLI](https://featherpanel.com/docs/cli/panel):

```bash
docker exec -it featherpanel featherpanel help
```

## Updating

Pull the new image and recreate the container with the same volume. Migrations run on start. To build the image
yourself, run `deploy/oci/build.sh` from a FeatherPanel checkout.

## Frequently asked questions

### Should I use the all-in-one image in production?

The multi-container Docker install is easier to update and inspect, and is what the installer sets up. The all-in-one image suits platforms that only run one container, and quick tests.

### Where is my data?

Everything lives in /home/container/data inside the container. Mount a volume there or the data is lost when the container is replaced.

### How do I create the first admin?

Set FEATHERPANEL_ADMIN_PASSWORD (and optionally the email and username) before the first start, or register in the browser. The first account becomes the administrator.
