Zabbix Web

Ricardo Martin | May 3, 2024 min read

Zabbix Frontend setup

As I mentioned on my previous post, I’ll be covering how to install the frontend using the official Zabbix Alpine Image docker image and on the server itself, in our case Ubuntu 24.04

This guide assumes that you are capable of deploying a ubuntu server on your own. If not, please follow this guide before proceeding.

Docker

If you don’t know how to install docker and docker compose, please follow this Guide before moving on. Alternatively, you can skip to Server Install

1. Create a new directory

Before we deploy the container, create a new directory that will store the compose file. On my docker server, I have a dedicated directory /opt/Docker/ for all services I deploy using docker-compose. I’m going to create a folder named ZabbixWeb:

mkdir /opt/Docker/ZabbixWeb

2. Create and configure a docker-compose.yaml file

Create a new file named docker-compose.yaml in the previously created folder.

vim docker-compose.yaml

Modify the compose file to reflect your environment!

  • Container Name: zabbix_web
  • Ports: The zabbix frontend exposes the port 8080 on the container, and I’ll be mapping that port to port 9015 on my host, since port 8080 is already in use. Feel free to set the port to 8080:8080 or 80:8080 to expose port 80 or 8080on your host.
  • Environment Variables:
    • DB_SERVER_HOST: IP of the database server, in my case 10.0.0.20
    • POSTGRES_USER: The user we created for the zabbix frontent server, zabbixweb
    • POSTGRES_PASSWORD: The password for the zabbixweb user
    • PHP_TZ: The time zone, in my case America/Chicago
version: "3.3"
services:
  zabbix-web-nginx-pgsql:
    container_name: zabbix_web
    ports:
      - 9015:8080
    environment:
      - DB_SERVER_HOST=10.0.0.20
      - POSTGRES_USER=zabbixweb
      - POSTGRES_PASSWORD=zabbix
      - PHP_TZ=America/Chicago
    image: zabbix/zabbix-web-apache-pgsql:alpine-6.4-latest
networks: {}

3. Deploy the container

From the directory we’ve created, deploy the container with docker compose

docker-compode up -d

Now you should be able to navigate to your hosts IP:Port and access the interface. In my case 10.0.0.250:9015

Done! The frontend should now be up and running!

Server Install

If docker is not for you, you can install the frontend on a standalone server.

Make sure your servers have a static IP address. Below is the /etc/netplan/*.yaml config I’m using

  • 10.0.0.23: Zabbix Web
  • 10.0.0.1: Gateway
  • 10.0.0.200: Internal DNS server
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 10.0.0.23/24
      routes:
        - to: default
          via: 10.0.0.1
      nameservers:
        addresses: [10.0.0.200]

1. Install the zabbix repository

First, we need to download the repository with wget

wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu24.04_all.deb

Once the download is done, install the packages uding dpkg

sudo dpkg -i zabbix-release_6.4-1+ubuntu24.04_all.deb

Now we need to update the packages

sudo apt update -y

2. Install the frontend

With the zabbix repository setup, we can install the frontend using apt

sudo apt install -y zabbix-frontend-php php8.3-pgsql zabbix-apache-conf

With the packages installed, we need to enable and start apache2

sudo systemctl enable apache2
sudo systemctl start apache2

It’s always good practice to disable the default apache website

sudo a2dissite 000-default.conf

3. Configure the Frontend

If you go to your server’s IP address/zabbix http://10.0.0.23/zabbix you should see the setup screen

zabbix web setup screen

If you get an error on this step, check the errors I got during the install

Once you get to the database config, your setup should look like the image below

db config fronted

Next set up the timezone and your preferred theme.

Remember that on this step we don’t specify the zabbix server name because we’ve setup HA

settings frontend

Follow the remaining steps and you should get the congratulations message.

gongrats frontend

Done! The frontend should now be up and running!

Issues I’ve encouter

Missing Locale

During the server setup, I got the following error

locale error

The locale on the server is not setup properly, let’s fix it.

Reconfigure Locale

If you don’t have the locales tools installed, run

apt-get clean && apt-get update && apt-get install -y locales

To start the configuration, run the command:

sudo dpkg-reconfigure locales

The output will look like the image below

localre reconfiguration

In my case, I need en_US, which is the option 97 from the image above

selectin locale

We need to select the default locale, which in my case is the option 3 for en_US

generating locale

Last thing to do is to restart apache2

sudo systemctl restart apache2

issue fixed

Done! The locale has been reconfigured and you should be able to reload the page and continue with the configuration

Next Steps

On the next post of this series, I will be covering the zabbix proxy setup. We’ll be covering how to install the zabbix proxy using the official Zabbix Alpine Image docker image and on the server itself, in our case Ubuntu 24.04

I’ll see you on the next one!