sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --add-port=10050/tcp --permanent
sudo firewall-cmd --add-port=10051/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports
sudo netstat -tulnp | grep 10051
ping zabbix-server
nslookup zabbix-server
docker network create zabbix-net
docker logs -f zabbix-server
docker ps | grep zabbix-server
docker ps -a | grep zabbix-server
docker start zabbix-server
docker network connect zabbix-net zabbix-server
docker network inspect zabbix-net
docker restart zabbix-db zabbix-server
docker exec -it zabbix-server bash
mysql -h zabbix-db -u zabbix -pzabbix_password
docker-compose down
docker-compose up -d
docker-compose up -d --no-deps zabbix-agent
vi /etc/zabbix/zabbix_agent2_active_checks.conf
agent - 172.18.0.4
server - 172.18.0.2
docker cp /var/lib/zabbix/zabbix_agent2_active_checks.conf /tmp/
docker cp zabbix-agent:/var/lib/zabbix/zabbix_agent2_active_checks.conf /tmp/
docker cp zabbix-agent:/etc/zabbix/zabbix_agent2_active_checks.conf /tmp/
vi /tmp/zabbix_agent2_active_checks.conf
docker cp /tmp/zabbix_agent2_active_checks.conf zabbix-agent:/etc/zabbix/zabbix_agent2_active_checks.conf
docker exec -it zabbix-agent cat /etc/zabbix/zabbix_agent2.conf | grep "Server="
Follow the official Docker documentation to install Docker on your machine:
🔗 Docker Installation Guide
Ensure you are on a Linux system where Docker is installed.
Run the following command to create a directory and navigate inside it:
mkdir zabbix-docker && cd zabbix-dockerNow, create a docker-compose.yml file inside this directory:
vi docker-compose.ymlPaste your Zabbix Docker Compose YAML configuration into this file and save it.
Run the following command inside the zabbix-docker directory:
docker compose -f docker-compose.yml up -dThis will start the Zabbix server in detached mode (-d).
The setup may take around 5 minutes.
Once running, use the following credentials to log in:
- Username:
root - Password:
root_password
- Username:
Admin - Password:
zabbix
✅ Zabbix Server is now running on Docker! 🚀 YouTube Video Link
- Enter Inside of Container:
docker exec -it <container_name_or_id> bash
docker container exec -it <container_name_or_id> bash
Sabse pehle dekho ki koi container chalu hai ya nahi:
docker ps -aAgar aapke Zabbix containers STOPPED dikh rahe hain, toh unko start karna hoga.
Agar aapne containers docker-compose.yml se chalaye the, toh unko wapas start karne ka best tarika ye hai:
docker compose -f docker-compose.yml up -dYeh command containers ko wapas start karegi bina naye containers create kiye.
Agar aap sirf existing containers start karna chahte ho, toh yeh command run karo:
docker start $(docker ps -aq)Yeh sab stopped containers ko wapas start karega.
Agar sirf specific containers (jaise zabbix-server aur zabbix-db) start karne hain, toh:
docker start zabbix-server zabbix-dbContainers sahi se start hue ya nahi, yeh check karne ke liye:
docker psAgar sab kuch sahi se chalu ho gaya hai, toh containers running mode me dikhne chahiye.
Agar aap chahte ho ki containers reboot ke baad automatically start ho jayein, toh restart policy enable karo:
docker update --restart unless-stopped $(docker ps -aq)Isse reboot ke baad bhi containers automatically start ho jayenge.
- Zabbix Server Running Check:
docker logs zabbix-server | tail -n 20 - Zabbix Web Access:
Browser mehttp://localhost:8080open karke dekho.
docker stop $(docker ps -aq)
docker start $(docker ps -aq)🔹 docker ps -aq → Yeh sabhi containers ke IDs deta hai.
🔹 docker stop → Yeh sabhi running containers ko stop karega.
Agar sabhi containers ko remove (delete) bhi karna hai, toh:
docker rm $(docker ps -aq)Agar sabhi images bhi delete karni ho, toh:
docker rmi $(docker images -q)
docker rmi -f $(docker images -q)| Parameter | Value |
|---|---|
| Root Password | root_password |
| Database Name | zabbix |
| Database User | zabbix |
| Database Password | zabbix_password |
| Parameter | Value |
|---|---|
| Zabbix Admin User | Admin (default) |
| Zabbix Admin Password | zabbix (default) |
| Parameter | Value |
|---|---|
| MySQL Root Password | root_password |
| PMA Host | zabbix-db |
1️⃣ Open Zabbix Web Interface: http://localhost:8080
2️⃣ Login karein:
- Username:
Admin - Password:
zabbix
3️⃣ Open phpMyAdmin: http://localhost:8081
- Username:
root - Password:
root_password