Hi, welcome! This is a guide to help you set up your own Snikket service. Once it is set up, you will be able to invite others to join you using the Snikket app and chat over your own private messaging server!
To follow this guide you will need:
For the server, you can use a VPS from a provider such as DigitalOcean (you can use this referral link for $100 credit), or you can use a physical device such as a Raspberry Pi. Note that if you run your server at home (which is really cool!) you may need to forward some ports on your router.
If you don’t have a domain name yet, see the FAQ “Do I need to register a domain name to use Snikket?” for some advice.
Also, if you plan to host your Snikket instance at home, check with your ISP whether you have a static or dynamic IP address on your home connection. For advice on setting up Snikket with a dynamic IP, see “Can I host Snikket if I have a dynamic IP address?”.
Note: Snikket provides a built-in web server that must be accessible on port 80. This guide assumes you are not running any existing websites on the same server. If you are running other HTTP services on the same server, refer to our reverse proxy documentation after you complete step 3.
Heads up! Snikket is currently still in its early stages. We’re still working hard on it and there are many improvements and features that are still to come.
If you have any questions, feedback, or words of encouragement, we’d love to hear from you! Email us at firstname.lastname@example.org.
Right, let’s get started!
First you need to find your server’s public (“external”) IP address. If you are using a hosted server, this may be shown in your management dashboard.
At a pinch you can use an online service, e.g. by running
curl -4 ifconfig.co in your terminal.
Now, add an A record for your IP address on the domain you want to run Snikket on. In the examples I’m going to use ‘chat.example.com’ as the domain, and ‘203.0.113.123’ as the IP address. This will be the primary domain for your Snikket instance.
# Domain TTL Class Type Target chat.example.com. 300 IN A 203.0.113.123
How to add records depends on where your DNS is hosted. Here are links to guides for a few common providers:
Tip: If you have an IPv6 address too, this is where you can add it - simply make another record for
chat.example.com. with the record
AAAA and put your IPv6 address as the target.
Now that you have an A record, you also need a couple more records. To avoid repeating the IP address everywhere, we’ll use CNAME records, which are just like aliases of the main domain:
# Domain TTL Class Type Target groups.chat.example.com 300 IN CNAME chat.example.com. share.chat.example.com 300 IN CNAME chat.example.com.
These subdomains provide group chat functionality and file-sharing respectively.
If you’re setting up Snikket at home, or behind a router or firewall, now is a good time to check that you have all the required ports open or forwarded. If you’re using a VPS and there is no firewall, you’re fine… onto the next step!
Docker is a handy tool for running self-contained services known as “containers”. We use Docker to provide Snikket in a clean way that works reliably across all different systems.
If you have the
docker-compose commands already available on your system, great! You can skip to Step 3 below. If not, continue reading.
Getting docker up and running can vary depending on what OS you’re running. Luckily Docker provides an installation guide for a range of operating systems. Follow the guide for your system:
Warning for Debian 10 (or Raspbian 10) (“buster”) Raspberry Pi and other ARM devices
There is a compatibility issue with the version of a package supplied with your OS that affects newer Docker images, including Snikket. Before proceeding with the setup, consult the advice in our troubleshooting guide so you can avoid any problems.
The Docker folks also provide a handy tool called
docker-compose which is not installed by default. We’re going to use it
as an easy way to launch and configure Snikket.
As per the installation instructions (see the ‘Linux’ tab there), install
docker-compose with the following commands:
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod a+x /usr/local/bin/docker-compose
This is exciting, we’re so close!
Create a configuration directory and switch to it:
mkdir /etc/snikket cd /etc/snikket
And then download our
curl -o docker-compose.yml https://snikket.org/service/resources/docker-compose.beta.yml
Now create another file called
snikket.conf in the same directory, using a text editor (such as nano, or vim).
This file is where your configuration goes. There are just a couple of options you need:
# The primary domain of your Snikket instance SNIKKET_DOMAIN=chat.example.com # An email address where the admin can be contacted # (also used to register your Let's Encrypt account to obtain certificates) SNIKKET_ADMIN_EMAILemail@example.com
Change the values to match your setup, save the file, and exit.
Here we go! Run:
docker-compose up -d
The first time you run this command docker will download Snikket. In a moment it should complete,
and Snikket should be running and accessible via the web (e.g.
soon as it has created certificates, it will redirect to HTTPS and show you a login page.
Now to set up your first account. To create yourself an admin account, run the following command:
docker exec snikket create-invite --admin --group default
Follow the link to open the invitation, and follow the instructions get signed in.
You can create as many links as you want and share them with people. Each link can
only be used once. Don’t forget to drop the
--admin part to create normal user accounts!
Once you’ve created your admin account, you can also log in to the web management portal
online by visiting
https://chat.example.com/ in your browser (obviously put your own
domain in there!).