> ## Documentation Index
> Fetch the complete documentation index at: https://docs.certgov.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrading

> How to upgrade CertForge Self-Hosted to a new version.

CertForge upgrades are a binary swap. The data directory is forward-compatible — new versions run schema migrations automatically on startup.

## Before you upgrade

1. Check the [changelog](https://certgov.app/changelog) for breaking changes
2. Back up your data directory:
   ```bash theme={null}
   tar -czf certforge-data-backup-$(date +%Y%m%d).tar.gz /opt/certforge/data
   ```
3. If using PostgreSQL, take a database backup:
   ```bash theme={null}
   pg_dump -U certforge certforge > certforge-db-backup-$(date +%Y%m%d).sql
   ```

***

## Upgrade steps

```bash theme={null}
# 1. Download the new binary (replace v0.1.535 with the target version)
VERSION=v0.1.535
curl -Lo /tmp/certforge.tar.gz \
  "https://github.com/CertForge-LLC/certforge-releases/releases/download/${VERSION}/certforge_${VERSION#v}_linux_amd64.tar.gz"
tar -xzf /tmp/certforge.tar.gz -C /tmp certforge
chmod +x /tmp/certforge

# 2. Verify it starts (--version doesn't need config)
/tmp/certforge --version

# 3. Stop the service
systemctl stop certforge

# 4. Keep the old binary as a rollback copy, then replace
cp /usr/local/bin/certforge /usr/local/bin/certforge.prev
cp /tmp/certforge /usr/local/bin/certforge

# 5. Start the service
systemctl start certforge
systemctl status certforge
```

Migrations (if any) run automatically on startup. Watch the logs:

```bash theme={null}
journalctl -u certforge -f
```

***

## Rollback

If something goes wrong, restore the previous binary and restart:

```bash theme={null}
# Assuming you kept the previous binary as certforge.prev
systemctl stop certforge
cp /usr/local/bin/certforge.prev /usr/local/bin/certforge
systemctl start certforge
```

If the database schema was migrated forward, rolling back the binary may fail on migrations that the older binary doesn't understand. Restore from your database backup in that case.

***

## Version pinning

All releases are available on the [releases page](https://github.com/CertForge-LLC/certforge-releases/releases). Asset format: `certforge_{version}_{os}_{arch}.tar.gz`

```bash theme={null}
# Example: pin to v0.1.500
VERSION=v0.1.500
curl -Lo /tmp/certforge.tar.gz \
  "https://github.com/CertForge-LLC/certforge-releases/releases/download/${VERSION}/certforge_${VERSION#v}_linux_amd64.tar.gz"
```

***

## In-product update notifications

When a new version is available, a banner appears in the dashboard License page (`/license`) and the running version is shown alongside the latest available version. Upgrades are always manual — CertForge will not update itself automatically.
