Zammad is an open-source customer support/ticketing solution based on Ruby and PostgreSQL. It helps organizations manage communications across various email, chat, and social media channels.

In this guide, you will learn how to install the Zammad Ticketing System on the Rocky Linux server. You will run Zammad with PostgreSQL, Nginx, and Elasticsearch.

Prerequisites

Before you start, make sure you have the following:

  • A Rocky Linux 9 server.
  • A non-root user with administrator privileges.
  • A domain name pointed to a server IP address.
  • A SELinux with status permissive.

Installing Dependencies

In this section, you will install dependencies for Zammad, this includes the EPEL repository, PostgreSQL database, Nginx web server, Redis, and Node.js.

First of all, add the EPEL repository to your Rocky Linux system with the following.

sudo dnf install epel-release -y

Now set up the default locale to en_US.UTF-8 with the command below.

sudo localectl set-locale LC_CTYPE=en_US.UTF-8

Now run the command below to enable the Node.js repository for version 18.

sudo dnf module enable nodejs:18 -y

Next, run the dnf command below to install dependencies for Zammad, including Nginx, PostgreSQL, Redis, and Node.js.

sudo dnf install imlib2 nginx postgresql-server postgresql-contrib libpq-devel redis nodejs

Input y to confirm and proceed.

<img alt="install dependencies" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/1-install-deps.png664ddc3d1fd11.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="213" loading="lazy" src="data:image/svg xml,” width=”750″>

After installation is finished, run the command below to initialize the PostgreSQL server.

sudo postgresql-setup initdb

Start and enable services for Nginx, PostgreSQL, and Redis with the command below.

sudo systemctl start nginx postgresql redis

sudo systemctl enable nginx postgresql redis

Lastly, check the Node.js version using the command below. Make sure you have Node.js 18.0 installed.

node --version

<img alt="start services and verify nodejs" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/2-start-services-verify-nodejs.png664ddc3d56dd9.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="319" loading="lazy" src="data:image/svg xml,” width=”750″>

Installing Elasticsearch

After installing Dependencies, you will need to install Elasticsearch. In this section, you will install Elasticsearch 7.x for Zammad.

Now run the command below to add the GPG key for the Elasticsearch repository.

rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

Add the Elasticsearch repository for the Rocky Linux server with the following command.

echo "[elasticsearch-7.x]

name=Elasticsearch repository for 7.x packages

baseurl=https://artifacts.elastic.co/packages/7.x/yum

gpgcheck=1

gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch

enabled=1

autorefresh=1

type=rpm-md"| tee /etc/yum.repos.d/elasticsearch-7.x.repo

Next, install Elasticsearch to your system with the following command. Input y to confirm the installation and accept the GPG key when prompted.

sudo dnf install elasticsearch

<img alt="install elasticsearch" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/3-install-elasticsearch.png664ddc3d94f58.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="239" loading="lazy" src="data:image/svg xml,” width=”750″>

After the installation is finished, install the ingest-attachment plugin to your Elasticsearch installation using the command below.

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

Input y to confirm the installation.

<img alt="install plugin" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/4-install-plugin-es.png664ddc3dd0660.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="320" loading="lazy" src="data:image/svg xml,” width=”750″>

Now reload the systemd manager and start the elasticsearch service using the command below.

sudo systemctl daemon-reload

sudo systemctl start elasticsearch

Once started, check the Elasticsearch with the curl command below. If your installation is successful, you will get detailed information about your Elasticsearch version.

curl -X GET 'http://localhost:9200'

<img alt="verify elasticsearch" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/5-start-verify-elasticsearch.png664ddc3e12f50.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="469" loading="lazy" src="data:image/svg xml,” width=”631″>

Increase Max connections in PostgreSQL

For PostgreSQl, you need to increase the default max_connections in the postgresql.conf file. This is needed by Zammad.

So log in as a postgres user with the command below.

su - postgres

Open the the PostgreSQL configuration data/postgresql.conf using the nano editor.

nano data/postgresql.conf

Change the default max_connections to 2000 like the following:

max_connections = 2000

Save the file and exit.

Now run the systemctl command below to restart the PostgreSQL service and apply your changes.

sudo systemctl restart postgresql

Setting up Firewalld

By default, firewalld is enabled on Rocky Linux. So now you need to open both HTTP and HTTPS services and allow traffic to Zammad.

Add both HTTP and HTTPS services to firewalld using the following command.

sudo firewall-cmd --zone=public --add-service=http --permanent

sudo firewall-cmd --zone=public --add-service=https --permanent

Now reload firewalld to apply new rules for HTTP and HTTPS.

sudo firewall-cmd --reload

Check the list of rules on firewalld using the command below. You will see both HTTP and HTTPS services available on firewalld.

sudo firewall-cmd --list-all

<img alt="setup firewalld" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/6-setup-firewalld.png664ddc3e47e8c.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="278" loading="lazy" src="data:image/svg xml,” width=”750″>

Installing Zammad Customer Support System

Now that you have dependencies installed and configured, you can start the Zammad installation, which can be done via the DNF package manager.

Add the GPG key for the Zammad repository using the command below.

sudo rpm --import https://dl.packager.io/srv/zammad/zammad/key

Now add the Zammad repository to your Rocky Linux server with the following command.

sudo wget -O /etc/yum.repos.d/zammad.repo 

https://dl.packager.io/srv/zammad/zammad/develop/installer/el/9.repo

Next, install zammad with the dnf command below. When prompted, type y to confirm the gpg key and Zammad installation.

sudo dnf install zammad

<img alt="install zammad" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/7-install-zammad.png664ddc3e878b3.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="239" loading="lazy" src="data:image/svg xml,” width=”750″>

After installation is finished, run the following command to check services for Zammad, including zammad, zammad-web, zammad-worker, and zammad-websocket.

sudo systemctl status zammad

sudo systemctl status zammad-web

sudo systemctl status zammad-worker

sudo systemctl status zammad-websocket

Make sure every service for Zammad is running.

<img alt="zammad running" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/8-zammad-running.png664ddc3eac0c2.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="215" loading="lazy" src="data:image/svg xml,” width=”750″>

Lastly, run the following command to set up integration between Zammad and Elasticsearch.

zammad run rails r "Setting.set('es_url', 'http://localhost:9200')"

zammad run rake zammad:searchindex:rebuild

After the command executed, this will create an elasticsearch index for Zammad.

Setting up Nginx as a reverse proxy

Now that you have installed Zammad, you will configure Nginx as a reverse proxy, and by default, Zammad provides a sample configuration that is available in/opt/zammad/contrib directory.

Copy the Nginx configuration for Zammad to /etc/nginx/conf.d/zammad.conf and open it using the nano editor command.

cp /opt/zammad/contrib/nginx/zammad.conf /etc/nginx/conf.d/zammad.conf

sudo nano /etc/nginx/conf.d/zammad.conf

Within the server_name option, change it with your domain.

server_name zammad.hwdomain.io;

Save and exit the file.

Now verify your Nginx configuration to ensure that you have proper syntax. If successful, you should get an output ‘syntax is ok‘.

sudo nginx -t

Lastly, run the command below to restart the Nginx service and apply a new server block configuration for Zammad.

sudo systemctl restart nginx

<img alt="setup nginx" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/9-setup-nginx.png664ddc3ee102d.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="162" loading="lazy" src="data:image/svg xml,” width=”750″>

With this, your Zammad installation should be ready and accessible.

Securing Zammad with HTTPS

Now that Nginx is configured, let’s secure Zammad via SSL/TLS certificates. You will install Certbot and generate SSL certificates utilizing certbot from Letsencrypt.

Install Certbot and Nginx plugin using the dnf command below. Type y to confirm the installation.

sudo dnf install certbot python3-certbot-nginx

After the installation is complete, run the certbot command below to generate SSL/TLS certificates and secure your Zammad installation. Make sure to change information of email address and domain name with your information.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d zammad.hwdomain.io

Once complete, your SSL/TLS certificates will be available at the /etc/letsencrypt/live/domain.com directory, and your Zammad also secured with HTTPS automatically.

Setting up Zammad installation

Launch your web browser and visit https://zammad.hwomdian.io/. If your installation is successful, you will be asked the following:

Click Setup a new system to start configuring Zammad.

<img alt="setup zammad" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/10-setup-new-system.png664ddc3f1cb19.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="429" loading="lazy" src="data:image/svg xml,” width=”750″>

Type details of your admin user and password for Zammad, then click Create.

<img alt="setup user" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/11-setup-admin.png664ddc3f519d6.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="628" loading="lazy" src="data:image/svg xml,” width=”689″>

Type your organization name, upload your logo, and click Next to continue.

<img alt="setup orgz" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/12-setup-orgz.png664ddc3f9027f.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="749" loading="lazy" src="data:image/svg xml,” width=”626″>

For the email settings, click Skip. You can configure this after finishing the installation.

<img alt="skip email" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/13-skip-email.png664ddc3fc1b23.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="473" loading="lazy" src="data:image/svg xml,” width=”663″>

Now you will see the Zammad dashboard like the following.

<img alt="dashboard" data-ezsrc="https://kirelos.com/wp-content/uploads/2024/05/echo/14-finished.png664ddc3feb748.jpg" ezimgfmt="rs rscb10 src ng ngcb9" height="506" loading="lazy" src="data:image/svg xml,” width=”750″>

Conclusion

Congratulations! You have completed the installation of the Zammad Ticketing System on the Rocky Linux 9 server. You have in Zammad running with PostgreSQL database, Nginx as a reverse proxy, Elasticsearch, and also secured with HTTPS via Certbot.