manual:installation:install_from_packages:debian_ubuntu

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:installation:install_from_packages:debian_ubuntu [2017/03/27 12:48]
martins-v fixing typo
manual:installation:install_from_packages:debian_ubuntu [2020/06/29 09:15] (current)
yuriii [Adding Zabbix repository]
Line 1: Line 1:
-==== 2 Debian/​Ubuntu ====+==== 2 Debian/​Ubuntu/​Raspbian ​====
  
-=== Overview ===+==== Overview ​====
  
 Official Zabbix packages are available for:  Official Zabbix packages are available for: 
  
-  * Debian ​(Wheezy)  +|Debian ​10 (Buster ​|[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=debian&​os_version=10_buster&​db=mysql|Download]] ​ | 
-  ​Debian 8 (Jessie) +|Debian 9 (Stretch) ​ |[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=debian&​os_version=9_stretch&​db=mysql|Download]] ​ | 
-  Ubuntu ​14.04 (Trusty Tahr) LTS +|Debian 8 (Jessie)  ​|[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=debian&​os_version=8_jessie&​db=mysql|Download]] ​ | 
-  ​Ubuntu 16.04 (Xenial Xerus) LTS+|Ubuntu ​20.04 (Focal Fossa) LTS  ​|[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=ubuntu&​os_version=20.04_focal&​db=mysql|Download]] ​ | 
 +|Ubuntu 18.04 (Bionic Beaver) LTS  |[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=ubuntu&​os_version=18.04_bionic&​db=mysql|Download]] ​ | 
 +|Ubuntu 16.04 (Xenial Xerus) LTS  ​|[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=ubuntu&​os_version=16.04_xenial&​db=mysql|Download]] ​ | 
 +|Ubuntu 14.04 (Trusty Tahr) LTS  |[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=ubuntu&​os_version=14.04_trusty&​db=mysql|Download]] ​ | 
 +|Raspbian (Buster) ​ |[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=raspbian&​os_version=10_buster&​db=mysql|Download]] ​ | 
 +|Raspbian (Stretch) ​ |[[https://​www.zabbix.com/​download?​zabbix=4.4&​os_distribution=raspbian&​os_version=9_stretch&​db=mysql|Download]] ​ |
  
-=== Repository installation ​===+==== Adding Zabbix repository ====
  
 Install the repository configuration package. This package contains apt (software package manager) configuration files. ​ Install the repository configuration package. This package contains apt (software package manager) configuration files. ​
  
-For Debian ​**8**, run:+For **Debian 10**, run the following commands:
  
-  # wget http://repo.zabbix.com/​zabbix/​3.4/​debian/​pool/​main/​z/​zabbix-release/​zabbix-release_3.4-1+jessie_all.deb +**Note!** For Debian 9, substitute '​buster'​ with '​stretch'​ in the commandsFor Debian 8, substitute '​buster'​ with '​jessie'​ in the commands.
-  # dpkg -i zabbix-release_3.4-1+jessie_all.deb +
-  # apt-get update+
  
-For Debian 7, substitute '​jessie'​ with '​wheezy'​ in the commands.+  # wget https://​repo.zabbix.com/​zabbix/​4.4/​debian/​pool/​main/​z/​zabbix-release/​zabbix-release_4.4-1+buster_all.deb 
 +  # dpkg -i zabbix-release_4.4-1+buster_all.deb 
 +  # apt update
  
-For Ubuntu ​**16.04**, run:+For **Ubuntu 20.04 (focal)**, run the following commands:
  
-  # wget http://​repo.zabbix.com/​zabbix/​3.4/​ubuntu/​pool/​main/​z/​zabbix-release/​zabbix-release_3.4-1+xenial_all.deb +  # wget https://​repo.zabbix.com/​zabbix/​4.4/​ubuntu/​pool/​main/​z/​zabbix-release/​zabbix-release_4.4-1+focal_all.deb 
-  # dpkg -i zabbix-release_3.4-1+xenial_all.deb +  # dpkg -i zabbix-release_4.4-1+focal_all.deb 
-  # apt-get update+  # apt update
  
-For Ubuntu ​14.04, substitute '​xenial'​ with '​trusty'​ in the commands.+  * For Ubuntu ​18.04, substitute ​'​focal'​ with '​bionic'​ in the commands. 
 +  * For Ubuntu 16.04, substitute '​focal'​ with '​xenial' in the commands. 
 +  * For Ubuntu 14.04, substitute 'focal' with '​trusty'​ in the commands.
  
-=== Server/​proxy installation ===+For **Raspbian**,​ run the following commands:
  
-To install server with MySQL:+  # wget https://​repo.zabbix.com/​zabbix/​4.4/​raspbian/​pool/​main/​z/​zabbix-release/​zabbix-release_4.4-1+buster_all.deb 
 +  # dpkg -i zabbix-release_4.4-1+buster_all.deb 
 +  # apt update 
 +==== Server/​proxy/​frontend installation ====
  
-  # apt-get ​install ​zabbix-server-mysql zabbix-frontend-php+To install ​Zabbix ​server ​with MySQL support:
  
-To install ​proxy with MySQL:+  # apt install ​zabbix-server-mysql
  
-  # apt-get ​install ​zabbix-proxy-mysql+To install ​Zabbix ​proxy with MySQL support:
  
-Substitute '​mysql'​ in the commands with '​pgsql'​ if using PostgreSQL, or with '​sqlite'​ if using SQLite3 (proxy only).+  # apt install zabbix-proxy-mysql
  
-** Creating database ​**+Substitute '​mysql'​ in the commands with '​pgsql'​ to use PostgreSQL, or with '​sqlite3'​ to use SQLite3 (proxy only). 
 + 
 +To install Zabbix frontend: 
 + 
 +  # apt install zabbix-frontend-php zabbix-apache-conf 
 + 
 +Substitute '​apache'​ in the command with '​nginx'​ if using the Nginx web server. 
 + 
 +=== Creating database ​===
  
 For Zabbix [[manual:​concepts:​server|server]] and [[manual:​concepts:​proxy|proxy]] daemons a database is required. It is not needed to run Zabbix [[manual:​concepts:​agent|agent]]. ​ For Zabbix [[manual:​concepts:​server|server]] and [[manual:​concepts:​proxy|proxy]] daemons a database is required. It is not needed to run Zabbix [[manual:​concepts:​agent|agent]]. ​
  
-<note warning>If Zabbix server and proxy are installed on the same host, their databases must be created with different names!</​note>​+<note warning>Separate databases are needed for Zabbix server and Zabbix ​proxy; they cannot use the same database. Therefore, if they are installed on the same host, their databases must be created with different names!</​note>​ 
 + 
 +Create the database using the provided instructions for [[manual:​appendix:​install:​db_scripts#​mysql|MySQL]] or [[manual:​appendix:​install:​db_scripts#​postgresql|PostgreSQL]].
  
-Create the database using the provided [[:​manual:​appendix:​install:​db_scripts|database creation scripts]] for MySQL/​PostgreSQL.+=== Importing data ===
  
-Now import initial schema and data for the server with MySQL:+Now import initial schema and data for the **server** with MySQL:
  
   # zcat /​usr/​share/​doc/​zabbix-server-mysql/​create.sql.gz | mysql -uzabbix -p zabbix   # zcat /​usr/​share/​doc/​zabbix-server-mysql/​create.sql.gz | mysql -uzabbix -p zabbix
Line 58: Line 78:
 With PostgreSQL: With PostgreSQL:
  
-  # zcat /​usr/​share/​doc/​zabbix-server-pgsql/​create.sql.gz | psql -U <​username> ​zabbix+  # zcat /​usr/​share/​doc/​zabbix-server-pgsql/​create.sql.gz | sudo -u zabbix psql zabbix
  
-For proxyimport initial schema:+With TimescaleDBin addition to the previous command, also run:
  
-  # zcat /​usr/​share/​doc/​zabbix-proxy-mysql/​create.sql.gz | mysql -uzabbix -p zabbix+  ​# zcat /​usr/​share/​doc/​zabbix-server-pgsql*/​timescaledb.sql.gz | sudo -u zabbix psql zabbix 
 + 
 +<note warning>​TimescaleDB is supported with Zabbix server only.</​note>​ 
 + 
 +For **proxy**, import initial schema: 
 + 
 +  ​# zcat /​usr/​share/​doc/​zabbix-proxy-mysql/​schema.sql.gz | mysql -uzabbix -p zabbix
  
 For proxy with PostgreSQL (or SQLite): For proxy with PostgreSQL (or SQLite):
  
-  # zcat /​usr/​share/​doc/​zabbix-proxy-pgsql/​create.sql.gz | psql -U <​username> ​zabbix +  # zcat /​usr/​share/​doc/​zabbix-proxy-pgsql/​schema.sql.gz | sudo -u zabbix psql zabbix 
-  # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite/create.sql.gz | sqlite3 zabbix.db+  # zcat /​usr/​share/​doc/​zabbix-proxy-sqlite3/schema.sql.gz | sqlite3 zabbix.db
  
-** Configure database for Zabbix server/​proxy ​**+=== Configure database for Zabbix server/​proxy ​===
  
-Edit zabbix_server.conf ​or zabbix_proxy.conf to use the created database. For example:+Edit zabbix_server.conf ​(and zabbix_proxy.confto use their respective databases. For example:
  
   # vi /​etc/​zabbix/​zabbix_server.conf   # vi /​etc/​zabbix/​zabbix_server.conf
Line 83: Line 109:
 Use ''​DBHost=''​ with PostgreSQL. You might want to keep the default setting ''​DBHost=localhost''​ (or an IP address), but this would make PostgreSQL use a network socket for connecting to Zabbix. Refer to the [[:​manual/​installation/​install_from_packages/​rhel_centos#​selinux_configuration|respective section]] for RHEL/CentOS for instructions. Use ''​DBHost=''​ with PostgreSQL. You might want to keep the default setting ''​DBHost=localhost''​ (or an IP address), but this would make PostgreSQL use a network socket for connecting to Zabbix. Refer to the [[:​manual/​installation/​install_from_packages/​rhel_centos#​selinux_configuration|respective section]] for RHEL/CentOS for instructions.
  
-** Starting Zabbix server process ​**+=== Starting Zabbix server process ​===
  
 It's time to start Zabbix server process and make it start at system boot: It's time to start Zabbix server process and make it start at system boot:
  
-  # service zabbix-server start +  # service zabbix-server ​apache2 php-fpm ​start 
-  # update-rc.d zabbix-server enable+  # update-rc.d zabbix-server ​apache2 php-fpm ​enable
  
-Substitute '​zabbix-server'​ with '​zabbix-proxy'​ to start Zabbix proxy process.+Substitute '​zabbix-server'​ with '​zabbix-proxy'​ to start Zabbix proxy process. Substitute '​apache2'​ with '​nginx'​ for Nginx web server.
  
-** PHP configuration ​for Zabbix frontend **+=== SELinux ​configuration ​===
  
-Apache configuration file for Zabbix frontend is located in /etc/httpd/conf.d/​zabbix.conf. Some PHP settings are already configured. But it's necessary to uncomment the "​date.timezone"​ setting and [[http://​php.net/​manual/​en/​timezones.php|set the right timezone]] for you.+Refer to the [[:​manual/​installation/​install_from_packages/​rhel_centos#​selinux_configuration|respective section]] for RHEL/​CentOS. 
 + 
 +As frontend and SELinux configuration is done, you need to restart ​Apache ​web server: 
 + 
 +  # service apache2 restart 
 + 
 +=== Frontend configuration === 
 + 
 +Depending on the web server used (Apache/​Nginx) edit the corresponding ​configuration file for Zabbix frontend
 + 
 +  * For Apache the configuration file is located in ''​/etc/zabbix/apache.conf''​. Some PHP settings are already configured. But it's necessary to uncomment the %%"%%date.timezone%%"%% setting and [[http://​php.net/​manual/​en/​timezones.php|set the right timezone]] for you.
  
   php_value max_execution_time 300   php_value max_execution_time 300
Line 101: Line 137:
   php_value upload_max_filesize 2M   php_value upload_max_filesize 2M
   php_value max_input_time 300   php_value max_input_time 300
 +  php_value max_input_vars 10000
   php_value always_populate_raw_post_data -1   php_value always_populate_raw_post_data -1
   # php_value date.timezone Europe/Riga   # php_value date.timezone Europe/Riga
  
-== SELinux ​configuration ​==+  * The zabbix-nginx-conf package installs a separate Nginx server for Zabbix frontend. Its configuration ​file is located in ''/​etc/​zabbix/​nginx.conf''​. For Zabbix frontend to work, it's necessary to uncomment and set ''​listen''​ and/or ''​server_name''​ directives.
  
-Refer to the [[:​manual/​installation/​install_from_packages/​rhel_centos#selinux_configuration|respective section]] for RHEL/CentOS.+  ​listen 80; 
 +  # server_name example.com;
  
-As frontend and SELinux configuration is done, you need to restart Apache web server:+  * Zabbix uses its own dedicated php-fpm connection pool with Nginx:
  
-  # service apache2 restart+Its configuration file is located in ''/​etc/​zabbix/​php-fpm.conf''​. Some PHP settings are already configured. But it's necessary to set the right [[http://​php.net/​manual/​en/​timezones.php|date.timezone]] setting for you.
  
-** Installing frontend **+  php_value[max_execution_time] = 300 
 +  php_value[memory_limit] = 128M 
 +  php_value[post_max_size] = 16M 
 +  php_value[upload_max_filesize] = 2M 
 +  php_value[max_input_time] = 300 
 +  php_value[max_input_vars] = 10000 
 +  ; php_value[date.timezone] = Europe/Riga
  
 Now you are ready to proceed with [[manual/​installation/​install#​installing_frontend|frontend installation steps]] which will allow you to access your newly installed Zabbix. Now you are ready to proceed with [[manual/​installation/​install#​installing_frontend|frontend installation steps]] which will allow you to access your newly installed Zabbix.
  
-=== Agent installation ===+Note that a Zabbix proxy does not have a frontend; it communicates with Zabbix server only. 
 +==== Agent installation ​====
  
 To install the agent, run To install the agent, run
  
-  # apt-get install zabbix-agent+  # apt install zabbix-agent
  
 To start the agent, run: To start the agent, run:
Line 126: Line 171:
   # service zabbix-agent start   # service zabbix-agent start
  
 +Substitute '​zabbix-agent'​ with '​zabbix-agent2'​ in these commands if using Zabbix agent 2 (only Debian 9/10, Ubuntu 18.04/​20.04).
 +
 +If you want to run Zabbix agent as root, see here [[https://​www.zabbix.com/​documentation/​4.4/​manual/​appendix/​install/​run_agent_as_root]].
 +==== Java gateway installation ====
 +
 +It is required to install [[:​manual/​concepts/​java|Java gateway]] only if you want to monitor JMX applications. Java gateway is lightweight and does not require a database.
 +
 +Once the required [[#​adding_zabbix_repository|repository]] is added, you can install Zabbix Java gateway by running:
 +
 +  # apt install zabbix-java-gateway
 +
 +Proceed to [[:​manual/​concepts/​java/​from_debian_ubuntu|setup]] for more details on configuring and running Java gateway.