How to Install Zulip Chat Server on Debian 9
In this tutorial, we will learn how to install the Zulip chat server software on Debian 9.
- A server running Debian 9 server.
- Non root user with sudo privileges.
First, you will need to update the system and install some packages on your system. You can install all of them using the following command:
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install python-dev python-pip openssl nano wget -y
Once all the packages are installed, you can proceed to install SSL certificate.
Install SSL Certificate
Zulip server works on HTTPS connection, so you will need to generate self-signed SSL certificate or obtain commercial SSL certificate. Here, we will generate a private certificate.
First, generate RSA key of 2048 bits using the following command:
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
Next, write RSA private key into zulip.key file using the following command:
openssl rsa -passin pass:x -in server.pass.key -out zulip.key
Next, generate signing request by running the following command:
openssl req -new -key zulip.key -out server.csr
Above command will ask you some information to generate the CSR. Provide all the information as shown below:
You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:IN State or Province Name (full name) [Some-State]:Gujarat Locality Name (eg, city) :Ahmedabad Organization Name (eg, company) [Internet Widgits Pty Ltd]:ENJ Organizational Unit Name (eg, section) :IT Common Name (e.g. server FQDN or YOUR name) :Hitesh Email Address :[email protected] Please enter the following 'extra' attributes to be sent with your certificate request A challenge password : An optional company name :
Next, generate the certificate files by running the following command:
openssl x509 -req -days 365 -in server.csr -signkey zulip.key -out zulip.combined-chain.crt
Next, copy the generated certificate and key using the following command:
sudo cp zulip.key /etc/ssl/private/zulip.key
sudo cp zulip.combined-chain.crt /etc/ssl/certs/zulip.combined-chain.crt
Install Zulip Server
First, you will need to download the latest version of the Zulip from their official website. You can download it with the following command:
After downloading, extract the downloaded file using the following command:
tar -xvzf zulip-server-latest.tar.gz
Next, rename extracted directory to zulip:
mv zulip-server-1.7.1 zulip
Next, change the directory to the zulip and install zulip by running the following command:
Once the installation is completed, you will need to make some changes in settings.py file:
sudo nano /etc/zulip/settings.py
Change the file as shown below:
EXTERNAL_HOST localhost ZULIP_ADMINISTRATOR [email protected] ADMIN_DOMAIN yourdomain.com DEFAULT_FROM_EMAIL [email protected] NOREPLY_EMAIL_ADDRESS [email protected]
Save the file when you are finished. Then, initialize the PostgreSQL database using the following command:
su zulip -c /home/zulip/deployments/current/scripts/setup/initialize-database
Once everything is setup correctly you will get the message that you have successfully configured your Zulip database.
Finally, restart the Zulip server using the following command:
su zulip -c /home/zulip/deployments/current/scripts/restart-server
Now, open your web browser and type the URL https://yourdomain.com and register your new account.
Congratulations! you have successfully installed Zulip chat server on Debian 9 server.