[comment]: # ({a25b2d94-91aab3e5})
# Debian/Ubuntu

[comment]: # ({/a25b2d94-91aab3e5})

[comment]: # ({545ec22f-d02acea9})
#### Overview

This section provides instructions on upgrading from Zabbix **7.4.x** to the latest version of Zabbix **8.0.x** using official Zabbix packages for Debian/Ubuntu.

::: notewarning
Before upgrading, please review the relevant [upgrade notes](/manual/installation/upgrade) and ensure that your system meets the [requirements](/manual/installation/requirements) for Zabbix 8.0.
:::

::: noteclassic
Consider running two parallel SSH sessions during the upgrade: one for executing the upgrade steps and another for monitoring server/proxy logs.
For example, run `tail -f zabbix_server.log` or `tail -f zabbix_proxy.log` in the second session to view the latest log entries and possible errors in real time.
This can be critical for production instances.
:::

For instructions on upgrading between Zabbix 8.0.x minor versions (for example, from 8.0.1 to 8.0.3), see [Upgrade between minor versions](#upgrade-between-minor-versions).

[comment]: # ({/545ec22f-d02acea9})

[comment]: # ({93ff8b03-93ff8b03})
#### Upgrade procedure

[comment]: # ({/93ff8b03-93ff8b03})

[comment]: # ({b7813e36-f8102233})
##### 1 Stop Zabbix processes

Stop Zabbix server to make sure that no new data is inserted into database:

```bash
systemctl stop zabbix-server
```

If upgrading Zabbix proxy, agent, or agent 2, stop these components too:

```bash
systemctl stop zabbix-proxy
systemctl stop zabbix-agent
systemctl stop zabbix-agent2
```

[comment]: # ({/b7813e36-f8102233})

[comment]: # ({906e7b99-ab13a6a4})
##### 2 Back up Zabbix database

Back up your existing Zabbix database to safeguard against upgrade failures (for example, disk space issues, power loss, or unexpected problems).

[comment]: # ({/906e7b99-ab13a6a4})

[comment]: # ({9978590c-6c141723})
##### 3 Back up Zabbix configuration files, PHP files, and Zabbix binaries

Back up existing Zabbix configuration files, PHP files, and Zabbix binaries.

For configuration files, run:

```bash
mkdir /opt/zabbix-backup/
cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
cp /etc/apache2/conf-enabled/zabbix.conf /opt/zabbix-backup/
```

For PHP files and Zabbix binaries, run:

```bash
cp -R /usr/share/zabbix/ /opt/zabbix-backup/
cp -R /usr/share/zabbix-* /opt/zabbix-backup/
```

[comment]: # ({/9978590c-6c141723})

[comment]: # ({08c42842-31c75b55})
##### 4 Update repository configuration package

Before proceeding with the upgrade, uninstall your current Zabbix repository package:

```bash
rm -Rf /etc/apt/sources.list.d/zabbix.list
```

You may also need to manually remove any old Zabbix packages from your working directory (e.g., ``rm zabbix-release_latest+debian12_all.deb``) before downloading the new one to prevent the package manager from reusing an outdated version during the upgrade process.

Then, install the latest repository configuration package to ensure compatibility with the newest packages and to include any recent security patches or bug fixes.

On **Debian 12**, run:

```bash
wget https://repo.zabbix.com/zabbix/8.0/release/debian/pool/main/z/zabbix-release/zabbix-release_latest+debian12_all.deb
dpkg -i zabbix-release_latest+debian12_all.deb
```

::: noteclassic
For older Debian versions, replace the link above with the correct one from the [Zabbix repository](https://repo.zabbix.com/zabbix/8.0/release/debian/pool/main/z/zabbix-release/). Note, however, that packages for these versions may not include all Zabbix components, and to upgrade those components from packages, consider upgrading your OS. For a list of components included, see [Zabbix packages](https://www.zabbix.com/download?zabbix=8.0&os_distribution=debian&os_version=11&components=agent&db=&ws=).
:::

On **Ubuntu 24.04**, run:

```bash
wget https://repo.zabbix.com/zabbix/8.0/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu24.04_all.deb
dpkg -i zabbix-release_latest+ubuntu24.04_all.deb
```

On **Ubuntu 22.04**, run:

```bash
wget https://repo.zabbix.com/zabbix/8.0/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu22.04_all.deb
dpkg -i zabbix-release_latest+ubuntu22.04_all.deb
```

::: noteclassic
For older Ubuntu versions, replace the link above with the correct one from the [Zabbix repository](https://repo.zabbix.com/zabbix/8.0/release/ubuntu/pool/main/z/zabbix-release/). Note, however, that packages for these versions may not include all Zabbix components, and to upgrade those components from packages, consider upgrading your OS. For a list of components included, see [Zabbix packages](https://www.zabbix.com/download?zabbix=8.0&os_distribution=ubuntu&os_version=20.04&components=agent&db=&ws=).
:::

You may see a prompt about the Zabbix repository configuration:

```bash
Configuration file '/etc/apt/sources.list.d/zabbix.list'
==> Deleted (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
D       : show the differences between the versions
Z       : start a shell to examine the situation
The default action is to keep your current version.
*** zabbix.list (Y/I/N/O/D/Z) [default=N] ?
```

Enter `Y` (or `I`) to install the package maintainer's version of the Zabbix repository configuration.

Then, update the repository information:

```bash
apt update
```

[comment]: # ({/08c42842-31c75b55})

[comment]: # ({a78e76d3-08c7383c})
##### 5 Upgrade Zabbix components

To upgrade Zabbix components, run:

```bash
apt install --only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent
```

-   If using PostgreSQL, replace `mysql` with `pgsql` in the command.
-   If upgrading proxy, replace `server` with `proxy` in the command.
-   If upgrading Zabbix agent 2, replace `zabbix-agent` with `zabbix-agent2 zabbix-agent2-plugin-*` in the command.

::: noteimportant
Upgrading Zabbix agent 2 with the `apt install zabbix-agent2` command could lead to an error.
For more information, see [*Known issues*](/manual/installation/known_issues#upgrading-zabbix-agent-2-6.0.5-or-older).
:::

You may see a prompt about the Zabbix server (or proxy) configuration:

```bash
Configuration file '/etc/zabbix/zabbix_server.conf'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ?  Your options are:
Y or I  : install the package maintainer's version
N or O  : keep your currently-installed version
D       : show the differences between the versions
Z       : start a shell to examine the situation
The default action is to keep your current version.
*** zabbix_server.conf (Y/I/N/O/D/Z) [default=N] ?
```

Enter the option that best fits your situation.
For example, enter `D` to compare the current and new configuration, then decide if you want to install the package maintainer's version (`Y` or `I`).

Then, to upgrade Zabbix frontend with Apache and restart Apache, run:

```bash
apt install zabbix-apache-conf
systemctl restart apache2
```

[comment]: # ({/a78e76d3-08c7383c})

[comment]: # ({06ed5d87-455f4e97})
##### 6 Review component configuration parameters

Review the relevant [upgrade notes](/manual/installation/upgrade_notes) to check if any changes in the configuration parameters are necessary.

For new optional parameters, see the [What's new](/manual/whatsnew) page.

[comment]: # ({/06ed5d87-455f4e97})

[comment]: # ({e83479d6-624a8fc7})
##### 7 Start Zabbix processes

Start the upgraded Zabbix components:

```bash
systemctl start zabbix-server
systemctl start zabbix-proxy
systemctl start zabbix-agent
systemctl start zabbix-agent2
```

[comment]: # ({/e83479d6-624a8fc7})

[comment]: # ({0d20ecac-49e4f43e})
##### 8 Clear web browser cookies and cache

After the upgrade, you may need to clear web browser cookies and web browser cache for the Zabbix web interface to work properly.

[comment]: # ({/0d20ecac-49e4f43e})

[comment]: # ({d6c45268-9bab02f2})
#### Upgrade between minor versions

It is possible to upgrade between Zabbix 8.0.x minor versions (for example, from 8.0.1 to 8.0.3).

First, update the repository information:

```bash
apt update
```

Then, to upgrade all Zabbix components, run:

```bash
apt install --only-upgrade 'zabbix*'
```

-   To upgrade Zabbix server only, replace `'zabbix*'` with `'zabbix-server*'` in the command.
-   To upgrade Zabbix proxy only, replace `'zabbix*'` with `'zabbix-proxy*'` in the command.
-   To upgrade Zabbix agent only, replace `'zabbix*'` with `'zabbix-agent*'` in the command.
-   To upgrade Zabbix agent 2 only, replace `'zabbix*'` with `'zabbix-agent2*'` in the command.

[comment]: # ({/d6c45268-9bab02f2})
