Skip to content

Znuny Ticket System with Docker

Using Docker with Znuny offers a flexible and efficient method for operating the ticket system in an isolated environment. This guide walks you through the basic steps of installation and management of Znuny with Docker.

There are important differences regarding Docker between Znuny and Znuny: Differences between Znuny and Znuny

The installation of the Znuny Helpdesk can be done either directly or via Docker. Docker enables a quick setup and ensures high consistency and isolation of the environment through containerization.

In a Docker environment, Znuny typically runs distributed across several containers:

  1. znuny_web_1: The web server.
  2. znuny_redis_1: Caching for improved performance.
  3. znuny_db_1: The database (MariaDB).
  4. znuny_daemon_1: Background services for Znuny.
  5. znuny_elastic_1: Elasticsearch for full-text search.
  6. znuny_nginx_1 (optional): Nginx as a reverse proxy for HTTPS connections.

Docker containers function like virtual machines, but are more lightweight and share the host’s operating system. They are isolated from each other and connected to Docker volumes, where their data is stored.

  • Start Docker service: systemctl enable docker
  • Stop Docker service: systemctl stop docker
  • Show all running containers: docker ps
  • Start individual container: docker start <container-name>
  • Stop individual container: docker stop <container-name>

To execute Znuny-specific commands within a Docker container, enter the znuny_web_1 container using an interactive terminal:

Terminal window
docker exec -it znuny_web_1 bash

Inside this container, you can then execute Znuny commands to perform various administrative and maintenance-related tasks.

Executing functions within the Docker container

Section titled “Executing functions within the Docker container”

Using Znuny within a Docker container opens up the possibility to execute a variety of commands directly that simplify the administration and maintenance of Znuny. Here is an overview of some of the available commands:

::: details Znuny Console Commands The core of Znuny’s command-line interface (CLI) is znuny.Console.pl, a powerful tool that can be used to perform administrative tasks directly from the command line. Some of the most common uses include:

  • Help: Displays help for existing commands.
  • List: Lists available commands.
  • Search: Searches for commands.

Admin-specific commands allow you to control various aspects of Znuny directly, such as:

  • Admin::Config::Update: Updates the value of a setting.
  • Admin::Package::Install: Installs a Znuny package.
  • Admin::User::Add: Adds an agent.

For developers, there are a number of commands to support development and testing:

  • Dev::Code::Generate::ConsoleCommand: Generates a skeleton for a console command.
  • Dev::Tools::CacheBenchmark: Runs a benchmark on the available cache backends.

For the care and maintenance of Znuny, the following commands can be used:

  • Maint::Cache::Delete: Deletes cache files created by Znuny.
  • Maint::Config::Rebuild: Rebuilds the Znuny system configuration.

:::

::: details Developer and maintenance tools In addition to administrative tasks, Znuny also supports specific commands for developers and system maintenance:

  • Dev::Package::Build: Creates a Znuny package file (opm) from a Znuny package source (sopm).
  • Maint::Log::Clear: Clears the Znuny logbook.

These commands support developers in creating and managing their Znuny modules and help system administrators maintain the system. :::

::: details Migration and updates For migrating from OTRS to Znuny or updating Znuny versions, special commands are available:

  • Dev::Tools::Migrate::OTRSToZnuny: Creates clean Znuny source files from OTRS source code or an OTRS OPM package.
  • Admin::Package::UpgradeAll: Updates all Znuny packages to the latest versions from the online repositories.

These commands facilitate the transition to Znuny and ensure that your system is always up to date. :::

Using these commands within the Znuny Docker container offers administrators and developers a flexible and powerful way to manage, customize, and extend their Znuny installation.

Below you will find other useful Docker commands that can be helpful for managing the Znuny ticket system:

  • Show container logs: To see the logs of a specific container, use docker logs <container-name>. This can be particularly helpful for diagnosing issues.

  • Show container list: To show all containers (running and stopped), use docker ps -a.

  • Show Docker images: With docker images, you can view all Docker images available on your system.

  • Create Docker volume: Volumes are the preferred mechanism for the persistence of data generated and used by Docker containers. Create a volume with docker volume create <volume-name>.

  • Show Docker networks: With docker network ls, you get a list of all Docker networks on your system.