# Install on a single host

> What a Corfedo host needs, and how to install Corfedo on it with the installer, choose certificates and sign-in, and run it unattended.

Source: https://docs.corfedo.ai/operate/single-host/

The installer sets up Corfedo on one Docker host with Docker Compose and prints the address and the setup secret. The workspace, its sign-in and sources are set up in the browser afterwards.

## Requirements

The installer checks these first.

| Item | Requirement |
| --- | --- |
| Operating system | Linux on amd64 or arm64 for production, or macOS with Docker Desktop for evaluation. Windows and WSL 2 are not supported. |
| Software | Docker Engine with Compose v2 (`docker compose`), `openssl`, `curl` and POSIX tools such as `tar`, `awk` and `sed`, for a user that may run `docker`. On Linux, add the user to the `docker` group. |
| Memory and CPUs available to Docker | 8 GiB and 2 CPUs. The installer warns below about 7 GB or 2 CPUs. Inside a container, such as LXC, it reads the container's limits. |
| Free disk | 45 GiB in the installation directory and where Docker keeps its volumes, usually `/var/lib/docker`. The installer checks the installation directory, warns below 40 GiB and stops below 10 GiB. The default storage budget needs 40 GiB of it free, see [Plan an installation](https://docs.corfedo.ai/operate/plan/#size-a-single-host). |
| Network | During installation and updates, the host downloads the release from GitHub and pulls images from their registries. |
| Host name | A name for Corfedo. With the bundled account service, sign-in uses a second name, `auth.<host>`, for example `auth.corfedo.example.com`. |
| First account | Its email address, when you use the bundled account service |

[Plan an installation](https://docs.corfedo.ai/operate/plan/#size-a-single-host) explains what uses the memory and disk.

## Choose certificates

Decide on certificates and sign-in before you run the installer.

| Choice | Flags | Certificates |
| --- | --- | --- |
| This machine | `--host corfedo.localhost` (default) | Caddy's local certificate authority. Browsers and clients must trust it. |
| Public domain | `--tls acme --acme-email EMAIL` | Let's Encrypt. DNS for the host, and for `auth.<host>` with the bundled account service, points at the machine, and ports 80 and 443 are reachable. |
| Internal domain | `--tls files --certificate FILE --key FILE [--ca FILE]` | Your certificate, covering the host, and `auth.<host>` with the bundled account service. `--ca` names its private certificate authority. |

`--tls files` needs the `--certificate` and `--key` flags, also when you answer the questions.

### Trust the local certificate authority

With Caddy's local certificate authority, every browser and client must trust `generated/caddy-root.crt`. The installer prints the command for your system. [Certificates and trust](https://docs.corfedo.ai/operate/single-host/certificates-and-trust/#trust-the-local-certificate-authority) shows it for each system and client.

## Choose sign-in

| Choice | Flag | Sign-in |
| --- | --- | --- |
| Bundled account service | `--identity bundled` | Keycloak at `auth.<host>`. The first account gets a temporary password, printed once. Create further accounts at `https://auth.{host}/admin/corfedo/console/`. |
| Your organization's identity provider | `--identity own` | Register Corfedo as a confidential web client with the callback address the setup page shows. The platform container must reach the provider's issuer address. |

## Install

```sh
curl -fsSL https://get.corfedo.ai | sh
```

It asks for the installation name, the host name, certificates, the HTTPS port, the listen address, sign-in, the first account and the artifact storage budget. Press Enter to keep a default. Each question is also a flag, which [Installer](https://docs.corfedo.ai/reference/installer/#options) lists with its default.

The installation directory is `~/corfedo` unless you pass `--dir DIR`. `--version VERSION` installs a given release. An interrupted installation continues where it stopped when you run the installer again.

## Install unattended

`--yes` takes the flags and the defaults without asking.

```sh
curl -fsSL https://get.corfedo.ai -o install.sh
sh install.sh install --host corfedo.example.com --tls acme --acme-email ops@example.com \
  --identity bundled --admin-email ada@example.com --yes
```

`sh install.sh --help` lists every command and option.

## Check the result

The installer ends with the address, the setup secret and, with the bundled account service, the first account's temporary password:

```text
Corfedo <version> is running at https://corfedo.example.com/

Open https://corfedo.example.com/setup and enter the setup secret:
  <setup secret>

Sign in with the first account of the account service: ada@example.com
  temporary password: <password> (you choose a new one at first sign-in; it is not shown again)
```

Copy the password now.

`sh ~/corfedo/install.sh status` shows the services, certificate expiry, artifact storage and whether the installation is ready.

## Files

The installer keeps everything in `~/corfedo`. Put your own Compose changes in `compose.override.yaml`. [Installer](https://docs.corfedo.ai/reference/installer/#files) lists every file and data volume.

## Next step

[Set up your workspace](https://docs.corfedo.ai/get-started/workspace/) at the address the installer printed, with the setup secret.
