> For the complete documentation index, see [llms.txt](https://docs.aquilax.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aquilax.ai/user-manual/install-aquilax/upgrade.md). Agents can also search and read this documentation through its [MCP server](https://docs.aquilax.ai/~gitbook/mcp).

# Upgrade

This guide explains how to upgrade an existing AquilaX On-Prem installation to the latest version.

All commands below assume AquilaX is installed in `~/aquilax-server`. If you installed it elsewhere, adjust the paths accordingly.

### Check if an upgrade is available

1. Open the latest release notes: <https://aquilax.ai/app/releases>
2. Open the release notes of your installation: `https://<your-server>/app/releases`
3. Compare the **Current version** shown on both pages.

If your version is older, or the page is not available on your installation, follow the steps below.

### Before you begin

* Have your **Deployment Key** ready (the same key used during installation).
* Plan a short maintenance window. AquilaX will be unavailable for a few minutes while services restart.
* Make sure no scans are currently running. Scans in progress during the upgrade will be interrupted.

### Step 1: Back up your installation

Create a backup of your configuration and database:

```
cd ~/aquilax-server
BACKUP=~/aquilax-backup-$(date +%Y%m%d-%H%M)
mkdir -m 700 -p "$BACKUP"

cp -a .env docker-compose.yml haproxy "$BACKUP"/
docker compose exec -T mongo mongodump --archive --gzip > "$BACKUP/mongo.archive.gz"

ls -lh "$BACKUP"
```

Confirm that `mongo.archive.gz` is not empty before continuing. Keep this backup until you have confirmed the upgrade was successful.

### Step 2: Update the installation files

Run the setup script from the directory that **contains** the `aquilax-server` folder (not from inside it):

```
cd ~
curl -fsSL https://gitlab.com/aquila-x/install-on-prem/-/raw/main/setup.sh | bash
```

The script detects your existing installation and updates it:

* Your existing configuration in `.env` (Running Key, SMTP settings, secrets) and your TLS certificate are kept.
* `docker-compose.yml` and `haproxy/haproxy.cfg` are replaced with the latest versions. If you made custom changes to these files, re-apply them using the copies in your backup.
* If you use an HTTP proxy, you will be asked for the proxy details again.

When the script finishes, it should report `All verification checks passed.`

Then confirm the internal service addresses are up to date:

```
grep -E '^(AQUILAX_SERVER|DAST_API|AI_ENDPOINTS|AQUILAX_GIT_URL)=' ~/aquilax-server/.env
```

The output should match the values below (quotes are optional). If any value differs, edit `~/aquilax-server/.env` and correct it.

```
AQUILAX_SERVER=http://aquilax-server-go:4000
DAST_API=http://vulnix0:4500
AI_ENDPOINTS=http://ai-model:8081
AQUILAX_GIT_URL=http://aquilax-git:8080
```

### Step 3: Download and start the new version

```
cd ~/aquilax-server
docker login registry.gitlab.com
docker compose pull
docker compose up -d --remove-orphans
docker compose restart haproxy
```

Make sure `docker compose pull` completes without errors before running `docker compose up`.

### Step 4: Verify the upgrade

1. Check that all services are running:

   ```
   docker compose ps
   ```
2. Open `https://<your-server>/app/releases` and confirm it shows the same **Current version** as <https://aquilax.ai/app/releases>.
3. Sign in to AquilaX and run a scan on one of your projects to confirm everything works end to end.

### Troubleshooting

If a service does not start or AquilaX is not reachable, check the logs of that service:

```
cd ~/aquilax-server
docker compose logs --tail 100 <service-name>
```

For example: `aquilax-server-go`, `aquilax-server`, `aquilax-ui`, `aquilax-worker` or `haproxy`.

If you need help, contact the AquilaX team at <https://aquilax.ai/contact> and include the relevant logs. Do not delete your backup folder until the issue is resolved.
