Welcome to our tutorial on how to install Zammad ticketing system on Ubuntu 20.04. According to Zammad documentation page, “Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and emails”.
Read about Zammad Ticketing system features on its features page, link provided below.
Zammad Ticketing system features
Install Zammad on Ubuntu 20.04
Prerequisites
There are a number of requirements that your system must meet (as of this writing) for installing Zammad
Software Requirements
- Ruby 2.6.6 for Zammad v3.4.1+: Zammad is written in Ruby and Java and hence Ruby is required.
- Relational Database Management systems (RDBMS) for storing content. The supported RDMS systems;
- MySQL 5.6+
- MariaDB 10.0+
- PostgreSQL 9.1+ (recommended and is supported by default).
- Reverse Proxy to deliver the static content of your application:
- Nginx 1.3+
- Apache 2.2+
- Elasticsearch (optional but highly recommended) to make search faster and to support advanced features like reports or searching by email attachment contents. Zammad v3.4+ is compatible with Elasticsearch 5.5–7.7.
Hardware Requirements
Please refer to Zammad hardware requirements page.
Install Zammad
Configure Locales in Ubuntu
In this tutorial, we will be installing Zammad with PostgreSQL which is supported by default.
As such, if you are using PostgreSQL database backend, you need to enable UTF-8 locale.
To check if UTF-8 local is enabled, run the locale
command from terminal as shown below.
locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
If from the above output you do not see the line,
LANG=en_US.UTF-8
The you need to generate and update the locales.
locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8
This will update the /etc/default/locale file with the set LANG environment variable.
Install Elasticsearch on Ubuntu
Zammad v3.4+ is compatible with Elasticsearch 5.5–7.7. Hence, let us install Elasticsearch 7.7 on Ubuntu.
Install the Elasticsearch repository signing key;
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch --no-check-certificate | sudo apt-key add -
Install Elasticsearch repo;
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
Install Elasticsearch 7.7 on Ubuntu;
apt update
apt install elasticsearch=7.7.1
Install Zammad on Ubuntu 20.04
Install Zammad repo lists on Ubuntu
Install the repo GPG signing key;
wget -qO- https://dl.packager.io/srv/zammad/zammad/key | sudo apt-key add -
Install Zammad repository;
curl -so /etc/apt/sources.list.d/zammad.list https://dl.packager.io/srv/zammad/zammad/stable/installer/ubuntu/20.04.repo
Update package cache;
apt update
Next, install Zammad and all the other required packages. The command below installs Zammad 3.6.0, which is the current stable release as of this writing?
apt install zammad
As the installation completes, you will see such an output;
...
Setting default Logging to file, set via "zammad config:set RAILS_LOG_TO_STDOUT=true" if you want to log to STDOUT!
# Starting Zammad
# Creating webserver bootstart
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
# Restarting webserver nginx
####################################################################################
Add your fully qualified domain name or public IP to servername directive of
nginx, if this installation is done on a remote server. You have to change:
/etc/nginx/sites-available/zammad.conf and restart nginx process.
Otherwise just open http://localhost/ in your browser to start using Zammad.
####################################################################################
...
Managing Zammad Services
Zammad
systemctl status zammad
systemctl stop zammad
systemctl start zammad
systemctl restart zammad
Only web application server
systemctl status zammad-web
systemctl stop zammad-web
systemctl start zammad-web
systemctl restart zammad-web
Only worker process
systemctl status zammad-worker
systemctl stop zammad-worker
systemctl start zammad-worker
systemctl restart zammad-worker
Only websocket server
systemctl status zammad-websocket
systemctl stop zammad-websocket
systemctl start zammad-websocket
systemctl restart zammad-websocket
Configure Elasticsearch for Zammad
Next, configure Elasticsearch search engine for Zammad.
Running Elasticsearch
We have already installed Elasticsearch 7.7.1. Thus, you can start and enable it to run on system boot by running the command below;
systemctl enable --now elasticsearch
Elasticsearch is now running with the default settings.
You can verify by running the command below;
curl localhost:9200
{
"name" : "ubuntu20",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "zALXjPYuQ9O4l2woJjHmFA",
"version" : {
"number" : "7.7.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "ad56dce891c901a492bb1ee393f12dfff473a423",
"build_date" : "2020-05-28T16:30:01.040088Z",
"build_snapshot" : false,
"lucene_version" : "8.5.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Install Elasticsearch Ingest Plugin
The ingest plugin extends Elasticsearch by providing additional ingest node capabilities.
To install the plugin, run the command below;
/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
Tune Elasticsearch
Increase the virtual memory map count;
echo vm.max_map_count=262144 >> /etc/sysctl.conf
sysctl -p
Increase the maximum size of an HTTP request body (default is 100MB).
echo "http.max_content_length: 400mb" >> /etc/elasticsearch/elasticsearch.yml
Restart Elasticsearch
systemctl restart elasticsearch
Configure Zammad to use Elasticsearch
Run the command below to define Zammad Elasticsearch URL, rebuild index, adjust the index namespacing as well as the file attachment indexing rules.
zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"
zammad run rake searchindex:rebuild
zammad run rails r "Setting.set('es_attachment_ignore', [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe', '.box', '.mbox' ] )"
zammad run rails r "Setting.set('es_attachment_max_size_in_mb', 50)"
Install Postfix for Zammad Email Notifications
To have Zammad deliver email notifications, you can install postfix;
apt install postfix
Accessing Zammad Interface
To access Zammad web interface, you need to update some few Nginx web server configurations.
Actually, the only change we can make is to make the site available and accessible from outside by changing the value of the server_name to your resolvable fully qualified domain name;
vim /etc/nginx/sites-available/zammad.conf
server {
listen 80;
# replace 'localhost' with your fqdn if you want to use zammad from remote
#server_name localhost;
server_name helpdesk.kifarunix-demo.com;
...
Save the file and exit.
Check Nginx syntax and restart it if all is well;
nginx -t
systemctl restart nginx
You can now access Zammad Web interface by navigating to the URL, http://<server-domain>
.
You will be welcomed by Zammad setup page;
Click on Setup new system to proceed.
Setup Zammad Administrator account.
Next, set you organization name, logo and the zammad url;
Configure Email notification settings. We use Gmail relay in our case. Ensure you have already installed Postfix.
Also, allow less secure app access prior to clicking Continue.
You can setup the Zammad comms channels. Click Email to setup email communication channel.
Once you are done with setup, you should land on the dashboard.
You can continue with the setup in order to fully use the Zammad.
Reference
Other Tutorials
Install Request Tracker (RT) with MariaDB on CentOS 8
Configure Request Tracker (RT) to send Mails using MSMTP via Office 365 Relay