# Updating Synq
URL: https://synquic.tech/docs/guides/updating.md

Keep your Synq up to date. Upgrade to the newest release by running the installer again with your license key, pin a version, and check what is running.

import { Step, Steps } from 'fumadocs-ui/components/steps';

New versions of Synq come out from time to time: bug fixes, new features, the occasional security patch.
Updating is how you get them onto your server. Nothing is ever pushed to your install from outside: you decide
when (and whether) you update.

<Callout title="Good to know">
- **Your apps keep running.** An update restarts only Synq's own services (API, dashboard and edge). The apps you
  deployed, and their data, are left alone.
- **Your data stays put.** The control-plane database, the settings and secrets in `/root/.synq/compose/.env`, the
  certificates in `/etc/letsencrypt` and the panel's address survive every update.
- **Migrations are automatic.** Database changes are applied when the new version starts (forward only).
</Callout>

## Where the version shows up

Open **Settings** and choose the **Instance** tab. The **Updates** section shows the version you're running, and
**View changelog & releases** opens the changelog at `https://synquic.tech/changelog`, with what changed in every
release. On the server, `synq --version` prints the installed version, which the installer keeps the same as the
panel's.

## Update

<Steps>

<Step>

### Run the installer again

Log in to the server and run the same command you installed with:

```bash
curl -sSL https://synquic.tech/install.sh | sh -s -- --key <KEY>
```

On a server where Synq is already installed, the installer upgrades it to the newest release. It keeps the
database, settings, certificates, the installation ID and the address the panel is served on. A new license key
given here replaces the old one.

</Step>

<Step>

### Check it

The installer ends with a summary: the version, the panel's address and the license state. Open the panel and
carry on. `sudo synq doctor` checks the database and services if anything looks wrong.

</Step>

</Steps>

To install a specific release instead of the newest one, add `--version X.Y.Z`. Going back to an older version is
refused, because database changes only go forward.

`synq update` on the server doesn't download anything on a key install: it tells you to run the installer again.

<Callout title="Changing the panel's address" type="info">
An update never moves the panel. `--domain` only applies to a first install; to give an installed panel a domain, or
move it to another one, use `sudo synq panel-domain <host>`. See
[Move the panel to a domain later](/docs/getting-started/installation#move-the-panel-to-a-domain-later).
</Callout>

## Before a big update

Turn on [panel backups](/docs/guides/panel-backups) to a destination off the server, and run one with **Back up
now** before you update. Your apps' own data is covered by [project backups](/docs/guides/backups-restore).

## About the always-on service

Synq runs as a **persistent service**: it starts again when the machine reboots and restarts itself if it
ever crashes. That keeps your apps online. What it does **not** do is change versions on its own: it keeps
running whatever version it was last installed with until you update it. `sudo synq stop` takes it down and
`sudo synq status` shows its state.

## Troubleshooting

<Callout title="This license key is not valid" type="warn">
The key is mistyped, or it was revoked. Copy it again, or email p@synquic.com to get a license key.
</Callout>

<Callout title="The upgrade did not finish" type="error">
Your data is untouched. Read the output above the error, fix the cause (disk space, outbound HTTPS to
`synquic.tech`) and run the installer again to retry.
</Callout>

<Callout title="The update stopped, naming POSTGRES_PASSWORD or BETTER_AUTH_SECRET" type="error">
Synq keeps its generated secrets only in `/root/.synq/compose/.env`. If an update can't read that file while the
database volume is still present, it stops **without changing anything** rather than generating values that
couldn't work. Restore the file (the previous one is kept at `.env.bak`) and run the installer again. Full steps:
[Troubleshooting → synq up refuses to regenerate secrets](/docs/troubleshooting#symptom-synq-up-refuses-to-regenerate-secrets).
</Callout>

<Callout title="I updated but still see the old version" type="warn">
Hard-refresh the panel in your browser. If **Settings**, **Instance**, **Updates** still shows the old version, the
upgrade didn't finish: read the installer's output for the step that failed, check `sudo synq status`, and run the
installer again.
</Callout>

## Related guides

<Cards>
  <Card title="Installation" href="/docs/getting-started/installation" description="Install, domains, license terms and removal." />
  <Card title="Install on a new server" href="/docs/getting-started/install-on-a-server" description="Every installer option, and what it changes on the server." />
  <Card title="Back up and restore the panel" href="/docs/guides/panel-backups" description="Scheduled off-server backups of the panel, and how to restore them." />
  <Card title="Roll back or redeploy" href="/docs/guides/rollback-redeploy" description="Undo a bad deploy of one of your apps, or ship the same code again." />
</Cards>
