Skip to content
Self-hosted, pre-configured, compliant prosody server from https://616.pub
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
www fix: update www/index.html May 7, 2019
.gitignore first commit Apr 25, 2019
Dockerfile first commit Apr 25, 2019
README.md first commit Apr 25, 2019
entrypoint.sh first commit Apr 25, 2019
import_certs.sh first commit Apr 25, 2019
prosody.cfg.lua fix: remove buggy vcard_muc module May 15, 2019
stats.sh fix: add timeout for nc to avoid defunct process May 15, 2019

README.md

Prosody

From 616.pub. Using the following steps to setup a self-hosted jabber server.

0. Requirements

  • A linux server with docker installed
    • As low as 1 core, 512MB memory
  • A domain under your control
  • A pair of reCaptcha keys filter spamming in register page

1. Define some varibles

# You need a domain
DOMAIN=yourdomain.com
# Your jabber account on that server, will be created as admin.
JID=yourname@yourdomain.com
# Your contact email
EMAIL=your@email.com
# recaptcha keys
RECAPTCHA_PRIVATE=xxx
RECAPTCHA_PUBLIC=yyy

2. DNS configure

Suppose your server IP is 1.2.3.4, the following records should be set ( replace DOMAIN with your real domain name):

;; A Records
DOMAIN.	1	IN	A	1.2.3.4
proxy.DOMAIN.	1	IN	A	1.2.3.4
room.DOMAIN.	1	IN	A	1.2.3.4

;; SRV Records
_xmpp-client._tcp.DOMAIN.	1	IN	SRV	0 5 5222 DOMAIN.
_xmpps-client._tcp.DOMAIN.	1	IN	SRV	0 5 5223 DOMAIN.
_xmpp-server._tcp.DOMAIN.	1	IN	SRV	0 5 5269 DOMAIN.

3. Obtain domain SSL certs

mkdir -p letsencrypt
docker run -it --rm --name certbot -v `pwd`/letsencrypt:/etc/letsencrypt \
  -p 80:80 certbot/certbot certonly --agree-tos --email $EMAIL \
  -d $DOMAIN -d room.$DOMAIN -d proxy.$DOMAIN --standalone -n

For updating those certs automatically, put this command to daily cron:

# replace /path/to/letsencrypt with previous absolute path
docker run -it --rm --name certbot -v /path/to/letsencrypt:/etc/letsencrypt \
  -p 80:80 certbot/certbot renew --standalone -n

4. Running

# database
mkdir prosody

# datetime when this server goes live
SINCE="2018/9/2"

docker run --rm -itd --name iprosody \
  -p 5223:5223 -p 5280:5280 -p 443:5281 \
  -p 5000:5000 -p 5222:5222 -p 5269:5269 \
  -v $PWD/prosody:/var/lib/prosody \
  -v $PWD/letsencrypt:/etc/letsencrypt \
  -e ADMIN_JID=$JID -e DOMAIN=$DOMAIN -e CONTACT_EMAIL=$EMAIL SINCE=$SINCE \
  -e RECAPTCHA_PRIVATE=$RECAPTCHA_PRIVATE \
  -e RECAPTCHA_PUBLIC=$RECAPTCHA_PUBLIC \
  ichuan/prosody

Now, head to https://DOMAIN to see it.

5. Maintenance

# Create your admin JID
docker exec -it iprosody prosodyctl adduser $JID
# or via web: https://${DOMAIN}/register
You can’t perform that action at this time.