Zammad is a free, open-source and fully-featured ticketing solution written in Ruby. It is a web-based system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails. You can easily deal with customer queries and complaints. Zammad comes with a rich set of features including, full-text search, auto-save, auditable, supports external authentication, support multi-language and much more.
In this tutorial, we will explain how to install Zammad Ticketing System on an Ubuntu 18.04 server.
Requirements
- A server running Ubuntu 18.04 with minimum 2 GB memory.
- A root password set up on your server.
Getting Started
Before starting, you will need to install Java on your system. You can install Java 8 with the following command:
# apt-get install openjdk-8-jdk -y
Once installed, you can check the version of Java with the following command:
# java -version
You should see the following output:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
Install Elasticsearch
First, you will need to install Elasticsearch for search functionality. By default, Elasticsearch is not available in the Ubuntu 18.04 default repository. So you will need to add Elasticsearch repository on your system.
First, install apt-transport-https with the following command:
# apt-get install apt-transport-https -y
Next, download and add Elasticsearch public key with the following command:
# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
Next, add Elasticsearch repository with the following command:
# echo "deb https://artifacts.elastic.co/packages/5.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 the installation has been completed, start elasticsearch service and enable it to start on system reboot with the following command:
# systemctl start elasticsearch
# systemctl enable elasticsearch
You can check the status of elasticsearch with the following command:
# systemctl status elasticsearch
You shoud see the following output:
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2019-07-31 04:05:36 UTC; 6s ago
Docs: http://www.elastic.co
Process: 11198 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec
(code=exited, status=0/SUCCESS)
Main PID: 11201 (java)
Tasks: 13 (limit: 1098) CGroup: /system.slice/elasticsearch.service └─11201 /usr/bin/java -Xms512m -Xmx512m -XX:+UseConcMarkSweepGC - XX:CMSInitiatingOccupancyFraction=75 - XX:+UseCMSInitiatingOccupancy
Jul 31 04:05:36 hitesh systemd[1]: Starting Elasticsearch...
Jul 31 04:05:36 hitesh systemd[1]: Started Elasticsearch.
Next, you also need to allow Elasticsearch to index file attachments. You can do it with the following command:
# /usr/share/elasticsearch/bin/elasticsearch-plugin install mapper-attachments
You should see the following output:
-> Downloading mapper-attachments from elastic
[=================================================] 100%
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: plugin requires additional permissions @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* 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 mapper-attachments
Once installed, restart elasticsearch to load the new plugin.
# systemctl restart elasticsearch
Install Zammad
By default, Zammad is not available in the Ubuntu 18.04 repository. So you will need to add Zammad repository to your system.
You can add the repository with the following command:
# wget -qO- https://dl.packager.io/srv/zammad/zammad/key | apt-key add -
# wget -O /etc/apt/sources.list.d/zammad.list
# https://dl.packager.io/srv/zammad/zammad/stable/installer/ubuntu/18.04.repo
Once the repository is added, update the repository and install Zammad with the following command:
# apt-get update -y
# apt-get install zammad -y
Once the installation has been completed, you can check the Zammad with the following command:
# systemctl status zammad
You should see the following output:
● zammad.service
Loaded: loaded (/etc/systemd/system/zammad.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-07-31 04:20:04 UTC; 4min 31s ago
Main PID: 21878 (sleep)
Tasks: 1 (limit: 1098)
CGroup: /system.slice/zammad.service
└─21878 /bin/sleep infinity
Jul 31 04:20:04 hitesh systemd[1]: Started zammad.service.
Next, you will need to make Zammad work with Elasticsearch and rebuild index. You can do it with the following command:
# zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"
# zammad run rake searchindex:rebuild
You can also add extra Elasticsearch index name space, ignore common binary file types and set the max attachment size with the following commands:
# 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)"
Configure Nginx for Zammad
By default, Zammad can be accessible only from localhost. So you will need to configure Nginx to access Zammad from remote location. You can do it by editing zammad virtual host file:
# nano /etc/nginx/sites-available/zammad.conf
Replace the localhost with your server FQDN or IP-Address
# server_name your-server-ip;
Save and close the file. Then, restart Nginx service to apply configuration changes.
# systemctl restart nginx
Access Zammad Web Interface
Now, open your web browser and type the URL http://your-server-ip. You will be redirected to the following page:
Click on the Setup new system button. You should see the following page:
Provide your administrator’s name, email, password and click on the Create button. You should see the following page:
Provide your Organization name, system URL, upload your logo and click on the Next button. You should see the following page:
Choose a proper email sending method and click on the Continue button. You should see the following page:
Now, click on the Skip button to finish the installation. You should see the Zammad dashboard in the following page:
Congratulations! You have successfully installed and configured Zammad Ticketing System on Ubuntu 18.04 server.
You can now easily deploy Zammad in a production environment.