Deploying Movim
Introduction
Movim is a federated social and chat platform that combines the features of a social network with instant messaging, all built on the XMPP protocol. It provides a modern, web-based interface for XMPP, enabling users to chat, share content, and participate in communities while maintaining the decentralized benefits of federation.
Written in PHP with a responsive interface built on JavaScript, Movim offers a compelling alternative to centralized social platforms. Users connect with any XMPP account and can communicate with millions of users across the XMPP network while enjoying a rich, social media-like experience.
Key highlights of Movim:
- XMPP Foundation: Built on open, federated XMPP protocol
- Social Features: Posts, shares, comments, and reactions
- Instant Messaging: Real-time chat with XMPP contacts
- Group Chat: Multi-user chat rooms (MUC)
- Communities: Subscribe to and participate in public channels
- Video Calls: WebRTC-based audio/video calling
- Media Sharing: Photos, videos, and file attachments
- News Feed: Aggregated posts from contacts and communities
- Explore: Discover public content and communities
- Stories: Ephemeral content sharing
- Notifications: Push notifications for messages and activity
- Mobile Friendly: Responsive design for all devices
- PWA Support: Install as progressive web app
This guide covers deploying Movim on Klutch.sh, connecting to an XMPP server, and configuring the platform.
Why Deploy Movim on Klutch.sh
Deploying Movim on Klutch.sh provides excellent advantages:
Simplified Deployment: Klutch.sh automatically builds and deploys Movim. Push to GitHub, and your social platform deploys automatically.
Persistent Storage: Attach volumes for configuration, cache, and media uploads.
HTTPS by Default: Klutch.sh provides automatic SSL certificates required for WebSocket and WebRTC features.
GitHub Integration: Connect your repository for automatic deployments.
Scalable Resources: Allocate CPU and memory based on user count and activity.
Environment Variable Management: Securely store configuration settings.
Custom Domains: Use your own domain for a branded experience.
Always-On Availability: Your platform stays accessible 24/7.
Prerequisites
Before deploying Movim on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Basic familiarity with Docker and XMPP concepts
- An XMPP server (or use public servers like jabber.org)
- PostgreSQL database
- (Optional) A custom domain
Understanding Movim Architecture
Movim consists of several components:
PHP Backend: Handles web requests and business logic.
WebSocket Daemon: Maintains persistent connections for real-time features.
PostgreSQL Database: Stores user sessions, cached data, and configuration.
XMPP Connection: Communicates with XMPP server for messaging and social features.
Preparing Your Repository
Repository Structure
movim-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile
Create a Dockerfile:
FROM movim/movim:latest
# Environment configurationENV MOVIM_DOMAIN=${MOVIM_DOMAIN}ENV MOVIM_PORT=8080ENV MOVIM_INTERFACE=0.0.0.0
# Database configurationENV MOVIM_DB_HOST=${MOVIM_DB_HOST}ENV MOVIM_DB_PORT=5432ENV MOVIM_DB_NAME=${MOVIM_DB_NAME}ENV MOVIM_DB_USER=${MOVIM_DB_USER}ENV MOVIM_DB_PASSWORD=${MOVIM_DB_PASSWORD}
# XMPP configurationENV MOVIM_XMPP_WHITELIST=${MOVIM_XMPP_WHITELIST}ENV MOVIM_ADMIN=${MOVIM_ADMIN}
# Create directoriesRUN mkdir -p /var/www/movim/cache /var/www/movim/log
# Expose portsEXPOSE 8080
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:8080/ || exit 1Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
MOVIM_DOMAIN | Yes | - | Public domain for Movim |
MOVIM_PORT | No | 8080 | HTTP port |
MOVIM_DB_HOST | Yes | - | PostgreSQL host |
MOVIM_DB_NAME | Yes | - | Database name |
MOVIM_DB_USER | Yes | - | Database username |
MOVIM_DB_PASSWORD | Yes | - | Database password |
MOVIM_XMPP_WHITELIST | No | - | Allowed XMPP domains |
MOVIM_ADMIN | No | - | Admin XMPP JID |
Deploying Movim on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8080
Provision PostgreSQL Database
Set up a PostgreSQL instance for Movim.
Push Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial Movim deployment"git remote add origin https://github.com/yourusername/movim-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a project named “movim” or “social”.
Create a New App
Create a new app and connect your GitHub repository.
Configure HTTP Traffic
In deployment settings:
Set Environment Variables
Configure your environment:
| Variable | Value |
|---|---|
MOVIM_DOMAIN | your-app-name.klutch.sh |
MOVIM_DB_HOST | Your PostgreSQL host |
MOVIM_DB_NAME | movim |
MOVIM_DB_USER | Your database user |
MOVIM_DB_PASSWORD | Your database password |
Attach Persistent Volumes
Add volumes for persistent data:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/movim/cache | 10 GB | Media cache |
/var/www/movim/log | 1 GB | Application logs |
Deploy Your Application
Click Deploy to build and launch Movim.
Run Database Setup
Initialize the database:
php vendor/bin/phinx migrateAccess Movim
Navigate to https://your-app-name.klutch.sh.
Using Movim
Creating an Account
- Navigate to your Movim instance
- Click Create an account or Log in
- Enter your XMPP credentials (user@domain.com)
- Set your display name and preferences
News Feed
The home feed shows:
- Posts from your contacts
- Activity from subscribed communities
- Shared content and reactions
Publishing Posts
Share content with your network:
- Click Write or the compose button
- Add text, images, or videos
- Select visibility (public, contacts, private)
- Publish
Messaging
Start conversations:
- Click Chats in navigation
- Select a contact or start new chat
- Send messages, files, and stickers
- Make audio/video calls
Communities
Join and participate in groups:
- Navigate to Explore
- Browse or search communities
- Subscribe to interesting groups
- Post and interact with members
Configuration
XMPP Server Whitelist
Restrict which XMPP servers users can log in from:
MOVIM_XMPP_WHITELIST=yourdomain.com,partner.comAdmin Configuration
Set administrator accounts:
MOVIM_ADMIN=admin@yourdomain.comAdmins can:
- Manage blocked servers
- View statistics
- Configure platform settings
Public or Private
Configure access mode:
- Open: Anyone with XMPP account can use
- Whitelist: Only specified domains
- Single: Locked to one XMPP server
Customization
Branding
Customize appearance:
- Access admin panel
- Navigate to Customization
- Set logo and colors
- Configure welcome message
Features Toggle
Enable/disable features:
- Video calls
- Stories
- Explore section
- Account creation
Troubleshooting
WebSocket Connection Failed
- Verify HTTPS is working
- Check WebSocket daemon is running
- Review proxy configuration
XMPP Connection Issues
- Verify XMPP server is accessible
- Check XMPP port (5222) connectivity
- Review XMPP server logs
Media Not Loading
- Check cache volume permissions
- Verify disk space available
- Review media upload settings
Database Errors
- Verify PostgreSQL connection
- Run migrations if needed
- Check database user permissions
Additional Resources
- Movim Official Website
- Movim GitHub Repository
- Movim Wiki
- XMPP Standards Foundation
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Movim on Klutch.sh provides a modern, federated social platform that combines the best of social networking with instant messaging. Built on XMPP, it offers true federation and interoperability with millions of users across the XMPP network. The combination of social features, real-time chat, and video calling makes Movim a compelling alternative to centralized platforms, while Klutch.sh simplifies deployment and maintenance.