How to install Zammad Community in ubuntu 20.04

Zammad is a web-based, open source user support/ticketing solution. It is an open source web based helpdesk and customer support system build to help you manage customer communications via several channels like twitter, telephone, chat, facebook, and e-mails. The Zammad helpdesk software is released under GNU AGPLv3 license. With its REST API, you can link other programs easily and get real-time information on all your channels and operations.

Zammad is developed in the programming languages Ruby and JavaScript. The name Zammad comes from the Bavarian dialect and means ā€œtogetherā€.

Step 1: Ensure your OS is updated

It is always a good practice to ensure that the OS has latest packages. Use this command to update:

sudo apt update
sudo apt upgrade

Step 2: Install Package dependencies

Next, let us install some of the dependencies. They need to be present in the system for future steps to work. Use this command:

sudo apt install wget curl apt-transport-https gnupg

For Zammad to work properly, your system must use the correct language environment.

sudo apt install locales
sudo locale-gen en_US.UTF-8
echo "LANG=en_US.UTF-8" | sudo tee /etc/default/locale

Step 3: Setup elasticsearch

Zammad uses elasticsearch, itā€™s search function is powered by Elasticsearch, and requires theĀ ingest attachment plugin.

Let us install elasticsearch on the server. First, Import the Elasticsearch PGP Key

Download and install the public signing key using this command:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg

Then set up the repository:

echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list

You can install the Elasticsearch package with this command after updating the repositories because we added a new repo:

sudo apt update && sudo apt install elasticsearch

To configure Elasticsearch to start automatically when the system boots up, run the following commands:

sudo systemctl daemon-reload
sudo systemctl enable elasticsearch

Elasticsearch can be started and stopped as follows:

sudo systemctl start elasticsearch
sudo systemctl stop elasticsearch

Ensure that it is running using the status command:

$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-03-18 11:06:37 UTC; 3min 3s ago
       Docs: https://www.elastic.co
   Main PID: 2045 (java)
      Tasks: 67 (limit: 4556)
     Memory: 2.3G
     CGroup: /system.slice/elasticsearch.service
             ├─2045 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -Djava.security.manager=allow -XX:+AlwaysPreTouch -Xss1m >
             └─2335 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller

Mar 18 11:06:13 axiobrim systemd[1]: Starting Elasticsearch...
Mar 18 11:06:37 axiobrim systemd[1]: Started Elasticsearch.

Checkout How to Install and Configure Elasticsearch on Ubuntu 20.04.

Step 4: Install Zammad

We can finally install Zammad. First add the gpg key

curl -fsSL https://dl.packager.io/srv/zammad/zammad/key | \
  gpg --dearmor | tee /etc/apt/trusted.gpg.d/pkgr-zammad.gpg> /dev/null

Then set up zammad repository:

echo "deb [signed-by=/etc/apt/trusted.gpg.d/pkgr-zammad.gpg] https://dl.packager.io/srv/deb/zammad/zammad/stable/ubuntu 20.04 main"| \
  tee /etc/apt/sources.list.d/zammad.list > /dev/null

Finally update the repositorie and install zammad:

sudo apt update && sudo apt install zammad

Step 5: Setting up Firewall

Zammad will be exposed as a web service. If you have ufw installed and enabled, you will need to allow port 80 and 443 for http and https traffic. Use these commands:

ufw allow 80
ufw allow 443
ufw reload

Manage services of Zammad

In general Zammad uses three services ā€“ these can be (re)started & stopped with the parentĀ zammad.

$ # Zammad service to start all services at once
$ systemctl (status|start|stop|restart) zammad

$ # Zammads internal railsserver
$ systemctl (status|start|stop|restart) zammad-web

$ # Zammads scheduler - relevant for all delayed- and background jobs
$ systemctl (status|start|stop|restart) zammad-worker

$ # Zammads websocket server for session related information
$ systemctl (status|start|stop|restart) zammad-websocket

Starting all services

sudo systemctl start zammad
sudo systemctl start zammad-web
sudo systemctl start zammad-worker
sudo systemctl start zammad-websocket

Confirm the service status using this command:

sudo systemctl status zammad
sudo systemctl status zammad-web
sudo systemctl status zammad-worker
sudo systemctl status zammad-websocket

Step 6: Configuring web access

The latest zammad service uses nginx to proxy traffic to the services. If you need to configure fqdn (domain access) like zammad.citizix.com you will need to update nginx config.

Open nginx settings with your default editor

sudo vim /etc/nginx/sites-enabled/zammad.conf

Then update this line to your fqdn.

server_name localhost;

This is how it would look with zammad.citizix.com

server_name zammad.citizix.com;

Navigate domain (zammad.citizix.com) and you should be able to use the system.

If you need to secure your site with ssl take a look at How to Secure Nginx with Letsencrypt on Ubuntu 20.04.

Last updated on Oct 14, 2024 11:46 +0300
comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy