This Docker image is designed for those who want to run their own XMPP server without dealing with complex configuration files.
You will need:
A computer with an external IP address capable of running Docker images for linux/amd64 or linux/arm64 architecture.
DNS setup. Suppose you want your XMPP server to be hosted on the domain example.com. The following domains must point (A or AAAA record) to the external IP address:
example.comupload.example.commuc.example.comproxy.example.compubsub.example.comAdditionally, you should configure the following SRV record to support direct TLS connections (XEP-0368):
_xmpps-client._tcp.example.com055223example.comAlternatively, you can use a subdomain, such as xmpp.example.com.
9999 can read and write to (the user does not need to exist; simply run chown -R 9999:9999 <YOUR-FOLDER>). This folder is needed to store user data independently of the Docker container's state. We will assume this folder is /home/prosody. Inside /home/prosody, create two subfolders: certs and data./home/prosody/certs folder, store the certificates for the main domain and the upload. subdomain. Suppose you want your XMPP server to be hosted on the domain example.com. Then the file and folder structure should be as follows (mirroring the structure of Let's Encrypt):
docker-compose.yml file with the following content (replace example.com with your domain and /home/prosody with the path to your data folder):
services:
server:
image: oixa/prosody:latest
restart: always
ports:
- "443:443/tcp"
- "3478:3478/tcp"
- "3478:3478/udp"
- "5000:5000/tcp"
- "5222:5222/tcp"
- "5223:5223/tcp"
- "5269:5269/tcp"
- "5281:5281/tcp"
- "50000-50100:50000-50100/udp"
environment:
PROSODY_ADMIN: [email protected]
PROSODY_ALLOW_REGISTRATION: false
PROSODY_DOMAIN: example.com
PROSODY_E2E_ENCRYPTION_REQUIRED: true
PROSODY_E2E_ENCRYPTION_WHITELIST: [email protected]
volumes:
- /home/prosody/certs:/app/certs:ro
- /home/prosody/data:/app/data
443:443/tcp mapping from the configuration.docker compose up -d.docker compose down && docker compose up.By default, Prosody stores uploaded files locally on disk. However, you can configure it to use AWS S3 for file storage.
To use S3, add environment variables starting from PROSODY_S3_ to your docker-compose.yml. Setting up the S3 bucket is beyond the scope of this README; please refer to AWS S3 documentation.
Note: Your bucket policy must allow public read access.
To switch back to local storage, simply remove the PROSODY_S3_ENABLED variable from the configuration or set it to an empty value.
Note: When switching, existing files are not migrated automatically. Files uploaded to S3 will remain in S3, and new files will be stored locally (or vice versa).
docker exec -it prosody-server-1 prosodyctl register <LOGIN> <DOMAIN> <PASSWORD>. Replace the placeholders with your data.docker logs -ft prosody-server-1docker exec -it prosody-server-1 cat turnserver.conf | grep static-auth-secret=PROSODY_DOMAIN: (MANDATORY) The domain where your server will operate.PROSODY_EXTERNAL_IP: External IP address. Useful if your computer has more than one external IP address.PROSODY_ADMIN: JID of the server administrator.PROSODY_ALLOW_REGISTRATION: Whether to allow free registration on the server.PROSODY_E2E_ENCRYPTION_REQUIRED: Whether E2E encryption is mandatory.PROSODY_E2E_ENCRYPTION_WHITELIST: A comma-separated list of JIDs for which E2E encryption is not mandatory.PROSODY_S3_ENABLED: Set any non-empty value to use AWS S3 as file storage.PROSODY_S3_ACCESS_ID: Access Key ID for S3 access.PROSODY_S3_SECRET_KEY: Secret Access Key for S3 access.PROSODY_S3_REGION: S3 region (e.g., us-east-1, eu-west-1).PROSODY_S3_BUCKET: S3 bucket name.PROSODY_S3_PATH: Path inside the bucket (e.g., uploads/).Content type
Image
Digest
sha256:7b6939db5…
Size
195.5 MB
Last updated
7 months ago
docker pull oixa/prosody