# Installing Eggent Enterprise

> Install Eggent Enterprise on one Linux server with Docker from a release bundle. What you need, what is in the bundle, the two runs of install.sh, working without internet, an internal CA, updates and backups.

Source: https://eggent.ai/docs/enterprise-install/

Eggent Enterprise is installed from a **release bundle**: one archive with every image and script inside. The installer needs no internet, so the server can stand in a closed network.

## What you need {#requirements}

- **One Linux server** (x86_64) with Docker 24 or newer and Compose v2. For about 100 people, plan on 8 vCPU, 32 GB of memory and 300 GB of SSD: usually about a third of the workspaces are awake at once, 300 to 500 MB each, and sleeping ones take nothing.
- **A domain** with two DNS records pointing at the server: the console's address, such as `eggent.company.tld`, and a wildcard record for the workspaces, `*.eggent.company.tld`.
- **A certificate** for both names: a wildcard from your internal CA or a public one.
- **A model endpoint** with an OpenAI-compatible API inside your perimeter, and its key if it needs one ([Models](https://eggent.ai/docs/enterprise-models.md)).
- **Postgres** is optional: one comes in the bundle. To use your own, set `DATABASE_URL` in `.env` and remove the service from `docker-compose.yml`.

## What is in the bundle {#bundle}

| File | What it is |
|---|---|
| Control plane image | The console, sign-in, creating and waking workspaces, the activity log |
| Workspace image | The agent each person gets |
| Caddy, Postgres | The web server and the database |
| `docker-compose.yml` | How the services run together |
| `install.sh`, `update.sh` | Installing and updating |
| `README` | The same steps in short |
| `manifest.txt`, `SHA256SUMS` | The release's versions and the files' checksums |

## Installing {#install}

The installer runs twice: the first run writes the settings, the second starts everything.

```bash
tar -xf eggent-enterprise-<release>.tar && cd eggent-enterprise-<release>
./install.sh
nano .env
./install.sh --cert fullchain.pem --key privkey.pem --ca company-ca.pem
```

1. **The first run** writes `.env` with freshly generated secrets and stops.
2. **Edit `.env`:** the domain, the support address people see and the number of places. Models can also be set here, or later in the console.
3. **The second run** loads the images from the archive, starts Postgres, Caddy and the control plane, creates the company and its administrator workspace and prints the console's address with a one-time password.

The bundle does not pull images from the internet (`EGGENT_IMAGE_PULL=0` is its default). `--ca` makes the workspaces and the control plane trust your internal CA: without it they cannot reach each other or your identity provider when its certificate comes from that CA.

## After installing {#after}

Sign in to the administrator workspace with the printed password, open the floating menu and choose **Company**. That is the [admin console](https://eggent.ai/docs/enterprise-console.md). The usual order: connect [company sign-in](https://eggent.ai/docs/enterprise-sso.md), connect [models](https://eggent.ai/docs/enterprise-models.md), upload [company skills](https://eggent.ai/docs/enterprise-skills.md), set up [credentials](https://eggent.ai/docs/enterprise-credentials.md) and the [activity log's](https://eggent.ai/docs/enterprise-audit.md) forwarding.

## Updating {#update}

```bash
./update.sh /path/to/eggent-enterprise-<new-release>
```

The script checks the checksums, keeps the current images under a rollback tag, loads the new ones, restarts the control plane (database migrations run by themselves, in order, each once), then recreates the employees' workspaces, waiting for any task an agent is running to finish first.

The current version is shown in the console and at `/health`.

**Rolling back:** tag the rollback images back (`docker tag eggent/control-plane:rollback-<date> eggent/control-plane:enterprise`, the same for `eggent/core`), then `docker compose up -d control-plane` and `docker exec eggent-control-plane node dist/cli.js roll`.

## Backups {#backups}

```bash
docker exec eggent-postgres pg_dump -U eggent -Fc eggent > eggent-$(date +%F).dump
tar -czf eggent-data-$(date +%F).tgz -C /opt/eggent data/instances data/shared data/org-skills data/caddy/data/certs .env
```

Keep `EGGENT_ORG_KEY_SECRET` from `.env` safe: the stored secrets are encrypted with it and cannot be read without it.

## Security {#security}

- The agent in a workspace has a shell. Isolation rests on a separate container for each person, with memory limits, and on the server's network rules.
- An agent can read its own tokens, so give them narrow rights ([Credentials](https://eggent.ai/docs/enterprise-credentials.md#security)).
- The activity log leaves the workspace as it is written, so the agent cannot erase it ([Activity log](https://eggent.ai/docs/enterprise-audit.md)).
