Atlantic.Net Blog

How to Install and Configure Zammad Ticketing System on Ubuntu

Zammad is an open-source ticketing system written in Ruby specially designed for customer support teams. It allows you to deal with customer queries and complaints from various channels, including web forms, Twitter, Facebook, email, chat, and more. Zammad also provides an API to integrate your telephone system. It offers a rich set of features including auto-save, full-text search, two-factor-authentication, and external authentication via Twitter, Facebook, LinkedIn, or Google.

In this tutorial, we will learn how to install Zammad Ticketing System on Ubuntu. This procedure is compatible with Ubuntu 20.04 and Ubuntu 22.04.

Step 1 – Install Java

Zammad requires Java to be installed on your server. You can install Java JDK 11 with the following command:

apt-get install openjdk-11-jdk -y

Once installed, verify the installed version of Java using the following command:

java -version

You should get the following output:

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

Step 2 – Install Apache Web Server and Other Dependencies

Next, you will need to install Apache webserver to host Zammad. You can install it with the following command:

apt-get install apache2 -y

Next, you will also need to install libssl on your server. First, add the Focal security repository with the following command.

echo "deb http://security.ubuntu.com/ubuntu focal-security main" | tee /etc/apt/sources.list.d/focal-security.list

Next, update the repository and install the libssl package with the following command.

apt update -y
apt install libssl1.1

Once you are finished, you can proceed to install the Zammad in the step.

Step 3 – Install ElasticSearch

Zammad uses Elasticsearch to provide the search function. By default, ElasticSearch is not available in the Ubuntu 20.04 default repository, so you will need to add the ElasticSearch repository to your system. You can add it with the following commands:

apt-get install apt-transport-https -y

apt-get install gnupg -y

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a 
/etc/apt/sources.list.d/elastic.list

Next, update the repository and install ElasticSearch with the following command:

apt-get update -y
apt-get install elasticsearch -y

Once installed, start the ElasticSearch service and enable it to start at boot:

systemctl start elasticsearch
systemctl enable elasticsearch

Next, you will need to allow Elasticsearch to index file attachments. You can do it with the following command:

/usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment

You should get the following output:

-> Installing ingest-attachment
-> Downloading ingest-attachment from elastic
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.lang.RuntimePermission accessClassInPackage.sun.java2d.cmm.kcms
* java.lang.RuntimePermission accessDeclaredMembers
* java.lang.RuntimePermission getClassLoader
* java.lang.reflect.ReflectPermission suppressAccessChecks
* java.security.SecurityPermission createAccessControlContext
* java.security.SecurityPermission insertProvider
* java.security.SecurityPermission putProviderProperty.BC
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed ingest-attachment

Next, restart ElasticSearch to apply the changes:

systemctl restart elasticsearch

Step 4 – Install Zammad

By default, Zammad is not available in the Ubuntu 20.04 default repository, so you will need to add Zammad repository in your system.

First, download and add the GPG key with the following command:

wget -qO- https://dl.packager.io/srv/zammad/zammad/key | apt-key add -

Next, add the Zammad repository with the following command:

wget -O /etc/apt/sources.list.d/zammad.list 
https://dl.packager.io/srv/zammad/zammad/stable/installer/ubuntu/20.04.repo

Next, update the repository and install Zammad with the following command:

apt-get update -y
apt-get install zammad -y

Once Zammad has been installed, you should get the following output:

Add your fully qualified domain name or public IP to servername directive of
apache2, if this installation is done on a remote server. You have to change:
/etc/apache2/sites-available/zammad.conf and restart apache2 process.
Otherwise just open http://localhost/ in your browser to start using Zammad.

################################################################################
####
Setting up gcc-9 (9.3.0-10ubuntu2) ...
Setting up libtool (2.4.6-14) ...
Setting up gcc (4:9.3.0-1ubuntu2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

Next, you will need to configure Zammad to work with Elasticsearch, add extra Elasticsearch index name space, and set the max attachment size. You can do that with the following command:

zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"
zammad run rake searchindex:rebuild
zammad run rails r "Setting.set('es_index', Socket.gethostname + '_zammad')"
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)"

Step 5 – Configure Apache for Zammad

Next, you will need to configure Apache webserver for Zammad.

First, disable the Apache default virtual host file with the following command:

a2dissite 000-default.conf

Next, edit the Zammad virtual host configuration file:

nano /etc/apache2/sites-available/zammad.conf

Change the ServerName and uncomment ServerTokens directive as shown below:

ServerName your-server-ip
# ServerTokens Prod
# RequestHeader unset X-Forwarded-User

Example:

Save and close the file, then restart the Apache service to apply the changes:

systemctl restart apache2

Step 6 – Access Zammad Web Interface

Now, open your web browser and access the Zammad web interface using the URL http://your-server-ip. You should see the following screen:

Click on the Setup new System. You should see the following screen:

Provide your admin username, password, and email and click on the Create button. You should see the following screen:

Provide your Organization name, upload a logo, provide system URL, and click on the Next button. You should see the following screen:

Select your MTA and click on the Continue button. You should see the following screen:

Click on the Skip button. You should see the Zammad dashboard in the following screen:

Conclusion

In this guide, you learned how to install and configure the Zammad ticketing system on Ubuntu 20.04. Try hosting your own online ticketing system with Zammad on VPS Hosting from Atlantic.Net.

Get a $250 Credit and Access to Our Free Tier!

Free Tier includes:
G3.2GB Cloud VPS a Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year