A complete, production-ready XMPP (Jabber) server setup with Prosody and Coturn TURN/STUN server, containerized with Docker Compose. Includes Converse.js web client integration and optional Nginx Proxy Manager for SSL management.
- Prosody 13.0++ - Modern XMPP server
- Coturn - TURN/STUN server for audio/video calls
- Converse.js - Built-in web client with OMEMO encryption
- HTTP File Upload - Share files up to 100MB
- MUC (Group Chat) - Persistent chat rooms with history
- Message Archive Management (MAM) - Message history
- REST API - For bot integration
- External Services - Voice/video calls via TURN
- Let's Encrypt ready - Automatic SSL (via NPM or manual)
- Docker and Docker Compose
- Domain name pointed to your server
- Linux server with public IP
- Basic knowledge of command line and XMPP
Make sure the following ports are open on your firewall/router and forwarded to your server:
| Service | Protocol | Port(s) | Description |
|---|---|---|---|
| XMPP Client | TCP | 5222 | Client-to-server (C2S) connections |
| XMPP Server | TCP | 5269 | Server-to-server (S2S) federation |
| XMPP HTTP | TCP | 5280 | HTTP interface (BOSH/WebSocket) |
| XMPP HTTPS | TCP | 5281 | HTTPS interface (secure BOSH/WebSocket, file upload) |
| TURN | TCP/UDP | 3478 | TURN/STUN server (main port) |
| TURN TLS | TCP | 5349 | TURN over TLS (secure) |
| TURN Relay | UDP | 20000-20500 | Media relay ports for voice/video |
Note: If you're using Nginx Proxy Manager, also open ports 80 and 443 for SSL certificate issuance.
-
Clone the project
git clone https://github.com/owl5053/xmpp_docker_compose.git cd xmpp-docker-compose -
Configure Domain Replace "your_server.ru" with your actual domain in:
- docker-compose.yaml - config/prosody/prosody.cfg.lua - config/coturn/turnserver.conf - user.sh - sendxmpp.sh - sendxmppfile.sh -
Generate Secrets
sh generate_a_new_secret.sh
Update the generated secret in Prosody and Coturn config files.
-
Set up SSL certificates (Option A or B)
Option A: Nginx Proxy Manager (Recommended)
Use the provided docker-compose.yaml configuration:
services:
npm:
image: 'jc21/nginx-proxy-manager:latest'
container_name: xmpp-npm
restart: unless-stopped
ports:
- '80:80'
- '443:443'
- '81:81'
volumes:
- ./data/npm:/data
- ./data/letsencrypt:/etc/letsencrypt
networks:
- npm-proxy
networks:
npm-proxy:
name: npm-proxy
driver: bridgeGet SSL certificates through the NPM web interface (port 81). Option B: Manual Let's Encrypt Place certificates in:
../npm/data/letsencrypt/live/npm-11/
Or manually modify the certificate paths in your configuration files.
-
Spin up Containers
docker compose up -d
-
Create Admin User
sh user.sh -a
Manage accounts easily with the user.sh script:
./user.sh -a # Add new user
./user.sh -p <user> # Change password
./user.sh -d <user> # Delete user
./user.sh -l # List all usersKeep your Prosody modules up to date with the update_all_modules.sh script:
./update_all_modules.sh # Update all installed modules at onceIts easy to send files and text on behalf of the bot, through scripts:
./sendxmpp.sh --help
./sendxmppfile.sh <Recipient's JID> <path to file>Once the stack is running, access the web chat via:
https://YOUR_DOMAIN:5281
- config/ – Prosody and Coturn configuration files.
- data/ – Database storage and SSL certificates.
- docker-compose.yaml – Main orchestration file.
- user.sh – Management utility script.
- Closed Registration: Users can only be created by the admin.
- Mandatory Encryption: TLS is required for all connections.
- Privacy: EXIF metadata stripping is enabled for file uploads.
You can use my pre-built Docker image for a simple XMPP bot:
Docker Hub: owl5053/xmpp_bot_slixmpp
Features:
- Send messages to users and MUC rooms
- REST API support
- Easy configuration via environment variables
- Based on Slixmpp library
MIT