Self-hosted, fast, lightweight Matrix server powered by Conduit (Rust)
📖 Persian Version (نسخه فارسی)
Important
Upgrading from Dendrite? If you previously installed Zanjir with Dendrite, you need to migrate to the new Conduit-based version. This will require a fresh installation and all data will be lost. See the Migration Guide for step-by-step instructions.
- Features
- Quick Start
- Installation
- User Guide
- Admin Panel
- Voice/Video Calls
- Custom Port
- Troubleshooting
- FAQ
- Contributing
- License
| Feature | Description |
|---|---|
| 🔐 Open Registration | Users can self-register via web interface |
| 👑 Admin Panel | Web-based admin dashboard with audit logging |
| 📞 Voice/Video Calls | TURN server for reliable NAT traversal |
| 🔧 Custom Ports | Configurable HTTPS/HTTP ports (no 443 conflict) |
| 📱 Element Web | Modern, responsive Matrix client |
| 🇮🇷 Persian UI | Fully translated interface |
| 🐳 Docker Powered | One-command installation |
| 🔒 Auto HTTPS | Let's Encrypt or self-signed certificates |
Requirements:
- Ubuntu 20.04+ or Debian 11+
- 2GB RAM minimum
- Domain name (or IP address)
- Ports: 80, 443 (or custom), 3478, 5349 (UDP)
One-line installation:
git clone https://github.com/MatinSenPai/zanjir.git ~/zanjir
cd ~/zanjir
sudo bash install.shAccess:
- Web App:
https://your-domain.com - Admin Panel:
https://your-domain.com/admin
git clone https://github.com/MatinSenPai/zanjir.git
cd zanjirsudo bash install.shInstallation prompts:
- Server address - Your domain or IP (e.g.,
matrix.example.comor185.123.45.67) - Admin email - For SSL certificates (domain mode only)
- HTTPS port - Default: 443 (press Enter), or custom (e.g., 8443)
After installation completes:
docker exec -it zanjir-dendrite /usr/bin/create-account \
--config /etc/dendrite/dendrite.yaml \
--username YOUR_USERNAME \
--adminExample:
docker exec -it zanjir-dendrite /usr/bin/create-account \
--config /etc/dendrite/dendrite.yaml \
--username admin \
--adminYou'll be prompted to set a password.
After installation, use the zanjir command to manage your server:
zanjirzanjir # Interactive menu
zanjir status # Show service status
zanjir logs # View logs (all services)
zanjir logs conduit # View specific service logs
zanjir restart # Restart all services
zanjir start # Start all services
zanjir stop # Stop all services
zanjir update # Update to latest version
zanjir backup # Backup all data
zanjir uninstall # Completely remove ZanjirWhen you run zanjir without arguments, you'll see a beautiful interactive menu:
╔═══════════════════════════╗
║ ║
║ Z A N J I R ⛓️ ║
║ ║
╚═══════════════════════════╝
Matrix Server Management Tool
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Main Menu:
1. Show Status
2. View Logs
3. Restart Services
4. Start Services
5. Stop Services
6. Update Zanjir
7. Backup Data
8. Uninstall
9. Exit
- Visit
https://your-domain.com - Click "Create account"
- Fill in username and password
- Start messaging!
- Create Room: Click
+button → New Room - Invite Users: Room settings → Invite users → Enter
@username:your-domain.com - Send Messages: Type and press Enter
- Voice Call: Click phone icon in room header
- Video Call: Click video icon in room header
Android:
iOS:
Configuration:
- Homeserver URL:
https://your-domain.com - Identity server: Leave blank
Visit: https://your-domain.com/admin
Login with your admin account credentials.
- Total users count
- Active users
- Total rooms
- View all users
- Disable user accounts
- Delete users
- View user status
- Track all admin actions
- Timestamps and IP addresses
- Target user tracking
- Detailed action logs
Disable a user:
- Go to
Userspage - Find user
- Click "Disable"
Delete a user:
- Go to
Userspage - Find user
- Click "Delete" → Confirm
All actions are automatically logged and visible in the Logs page.
Zanjir includes a TURN server (coturn) for reliable voice/video calls.
TURN server helps users behind NAT/firewalls connect:
- Direct P2P when possible
- TURN relay when necessary
- Automatic fallback
Required ports:
| Port | Protocol | Purpose |
|---|---|---|
| 3478 | UDP | STUN/TURN |
| 5349 | UDP | TURN-TLS |
UFW example:
sudo ufw allow 3478/udp
sudo ufw allow 5349/udp- Create two accounts
- Create a room, invite both users
- Click phone/video icon
- Accept call on other end
If port 443 is already in use, you can use a custom port.
During install.sh, enter your desired port:
HTTPS port (default: 443): 8443
This will:
- Use port 8443 for HTTPS
- Use port 8080 for HTTP (auto-calculated)
- Update all configurations
https://your-domain.com:8443
- Edit
.env:nano .env
- Change
HTTPS_PORTandHTTP_PORT - Restart services:
docker compose down docker compose up -d
Error: connection refused to download.docker.com
Solution: Script automatically uses Iranian mirrors:
docker.arvancloud.irregistry.docker.ir
Check:
- Verify registration is enabled in docker-compose.yml:
CONDUIT_ALLOW_REGISTRATION: "true" - Check
element-config.json:"UIFeature.registration": true - Restart containers:
docker compose restart
Solutions:
- Check TURN server is running:
docker ps | grep coturn - Verify firewall allows UDP 3478, 5349
- Check TURN secret in
.envmatchesTURN_SECRETenvironment variable
Solutions:
- Verify user is admin:
docker exec -it zanjir-dendrite /usr/bin/create-account \ --config /etc/dendrite/dendrite.yaml \ --username YOUR_USERNAME \ --admin - Check admin container logs:
docker logs zanjir-admin
Solution: Use custom port during installation, or change port in .env
Q: Can I use an IP address instead of domain?
A: Yes! The installer detects IP mode and uses self-signed certificates.
Q: Is federation enabled?
A: No, Zanjir is designed for isolated single-server deployment.
Q: Can users video call externally?
A: Only within your Zanjir server (federation disabled).
Q: How are passwords stored?
A: Bcrypt hashed in PostgreSQL.
Q: Is end-to-end encryption supported?
A: Yes! Element/Matrix supports E2EE by default.
Q: What about audit logs?
A: Admin actions logged in SQLite (admin/audit_log.db).
Q: How many users can it handle?
A: Conduit is extremely lightweight. A 1GB VPS can handle ~100-500 users with ease. Conduit uses ~50MB RAM vs Dendrite's 200-500MB.
Q: What about backups?
A: Backup Docker volumes:
docker run --rm \
-v zanjir-postgres-data:/data \
-v $(pwd):/backup \
ubuntu tar czf /backup/postgres-backup.tar.gz /dataContributions welcome! Please:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
MIT License - see LICENSE file
- Matrix.org - Open protocol
- Conduit - Fast, lightweight Rust homeserver
- Element - Web client
- Coturn - TURN server
- Caddy - Reverse proxy
- GitHub Issues: Report bugs
- Discussions: Ask questions
Made with ❤️ for secure, private communication