Deploy Zulip messaging using podman play
Tags: podman, zulip, fedora, kompose
Published: 2020-09-03 11:39:42

---
title: Deploy Zulip messaging using podman play
published: true
description: 
tags: podman, zulip, fedora, kompose
//cover_image: https://direct_url_to_image.jpg
---

# What is Zulip?

[Zulip][1] is like Slack or Mattermost, a messaging server for teams to communicate on a project. Overview of Zulip features is out of scope for this article, but for those interested you can find more information [here][2].

# My reasons for writing this article

My reasons for writing this article are two-fold. 

- Dissatisfaction with the [Mattermost][3] interface.. particularly threads being hard to read.
- My daily driver being Fedora 32, which utilizies cgroups version 2 doesn't support Docker out of the box.  

The Mattermost interface has many great things and its integrations are amazing, but it handles threads in a dis-satisfactory manner.

Without Docker I have to translate projects to podman as I go my local environment.  I use various tools to do this [podman-compose][4], [Kompose][5], `podman generate`, etc.

# Deploying Zulip with podman

This morning with a lot of work translating [docker-zulip][8], I was able to create the `zulip-deployment.yaml` file [here][6] to deploy Zulip. 

## Presumptions

- You have an email server supporting TLS and user login.
- You have a GitLab account / Server

## Configuration

Defaults are fairly secure but for a production environment there are still some things that require tightening.  With that warning out of the way to get `zulip-deployment.yaml` up and running the following substitutions are required.

|Substitution Value|Description|
|-|-|
|__POSTGRE_SECURE_PASSWORD|The password for the integrated postgresql database|
|__MEMCACHED_SECURE_PASSWORD|The password for the integrated memcached cache|
|__RABBITMQ_SECURE_PASSWORD|The password for the integrated rabbitmq server|
|__REDIS_SECURE_PASSWORD|The password for the integrated redis server|
|__EXTERNAL_HOST_URL|Zulip externally accessible URL e.g. message.myproject_zulip.com, Can also be set to IP or localhost, and port may be included as desired.|
|__ZULIP_SECRET|random string of characters (used internally) preferably 50 characters long.|
|__EMAIL_SERVER_URL|URL of your email server|
|__EMAIL_USER_NAME|User for authenticating your email server|
|__EMAIL_USER_PASSWORD|Password for above username|
|__GITLAB_URL|Url of your GitLab instance, or of Gitlab.com|
|__GITLAB_APPLICATION_KEY|Application key generated as described [here][7]|
|__GITLAB_APPLICATION_SECRET|Application secret generated as described [here][7]|
|__ADMIN_ERROR_EMAIL|Email at which to recieve errors from Zulip|

## Deploy

Deployment should be as easy as running the following command.

```bash
podman play kube zulip-deployment.yaml
```

```
[rustysysdev@localhost zulip-podman-play]$ podman play kube zulip-deployment.yaml 
Pod:
4c475bb55f6f05828d5cb7efe499b8e84722138f16df263320e541722003fe9b
Containers:
bd8762327b8ab970d6a0c7bc8e6f0ff9ea217751e42225ad207d21e82ae834cc
5567fccbadf943a744264deec4a1b2dfd53ec8e49239660ffaf0a2b0008ba8ee
d503c0b9944428a1849e400315ffdff49b2249de9340387e30e089c20f0a9d58
c06c4ea471de0cc72388fdbf69d6ebbceaddcb4535303a3e293cd6e21afe960f
39cdccdcb981802c3f7e6a1168d590452502aa7097857f8136b18ea5b96079d0
```

Verify the deployment is complete.

```bash
podman logs zulip-pod-0-zulip
```

```
...
2020-09-03 07:05:21,303 INFO success: zulip_events_embed_links entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,303 INFO success: zulip_events_missedmessage_mobile_notifications entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,303 INFO success: zulip_events_error_reports entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,304 INFO success: zulip_events_digest_emails entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,304 INFO success: zulip_events_email_senders entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-09-03 07:05:21,305 INFO success: zulip_deliver_scheduled_messages entered RUNNING state, process has stayed up for > than 1 seconds (startsec
```

## Post deploy setup

After deploying the Zulip server and before using it, you will need to create a new organization.  This can be accomplished using the following commands.

1. exec into your container.
    
    ```bash
    podman exec -ti zulip-pod-0-zulip bash
    ```
    
    output:
    
    ```
    [rustysysdev@localhost zulip-podman-play]$ podman exec -ti zulip-pod-0-zulip bash
    root@zulip-pod-0:/#
    ```
    
2. run the following commands to get a realm creation link.
    
    ```bash
    su zulip && cd /home/zulip/
    $(find ./ -name manage.py) generate_realm_creation_link
    ```
    
    output:
    
    ```
    root@zulip-pod-0:/# su zulip && cd /home/zulip/
    zulip@zulip-pod-0:~$ $(find ./ -name manage.py) generate_realm_creation_link
    Please visit the following secure single-use link to register your 
    new Zulip organization:
    
        https://localhost.localdomain:8443/new/4t1f3r0qet4eu0z0phyork8a
    
    ```
    
3. Open the resultant link in your browser and follow the steps to setup your administrator account and organization.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wbdwias2reu5lxmb0tai.png)

# Conclusion

Creating the zulip server is easy, once finished you can invite users, who can then login using GitLab OAuth!

If you have any questions do not hesitate to ask!

[1]: https://zulipchat.com/why-zulip/
[2]: https://zulipchat.com/features/
[3]: https://mattermost.com/
[4]: https://github.com/containers/podman-compose
[5]: https://github.com/kubernetes/kompose
[6]: https://github.com/rustysys-dev/zulip-podman-play/blob/master/zulip-deployment.yaml
[7]: https://github.com/zulip/zulip/blob/master/zproject/prod_settings_template.py#L154
[8]: https://github.com/zulip/docker-zulip