Skip to content

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
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile:

FROM movim/movim:latest
# Environment configuration
ENV MOVIM_DOMAIN=${MOVIM_DOMAIN}
ENV MOVIM_PORT=8080
ENV MOVIM_INTERFACE=0.0.0.0
# Database configuration
ENV MOVIM_DB_HOST=${MOVIM_DB_HOST}
ENV MOVIM_DB_PORT=5432
ENV MOVIM_DB_NAME=${MOVIM_DB_NAME}
ENV MOVIM_DB_USER=${MOVIM_DB_USER}
ENV MOVIM_DB_PASSWORD=${MOVIM_DB_PASSWORD}
# XMPP configuration
ENV MOVIM_XMPP_WHITELIST=${MOVIM_XMPP_WHITELIST}
ENV MOVIM_ADMIN=${MOVIM_ADMIN}
# Create directories
RUN mkdir -p /var/www/movim/cache /var/www/movim/log
# Expose ports
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1

Environment Variables Reference

VariableRequiredDefaultDescription
MOVIM_DOMAINYes-Public domain for Movim
MOVIM_PORTNo8080HTTP port
MOVIM_DB_HOSTYes-PostgreSQL host
MOVIM_DB_NAMEYes-Database name
MOVIM_DB_USERYes-Database username
MOVIM_DB_PASSWORDYes-Database password
MOVIM_XMPP_WHITELISTNo-Allowed XMPP domains
MOVIM_ADMINNo-Admin XMPP JID

Deploying Movim on Klutch.sh

    Provision PostgreSQL Database

    Set up a PostgreSQL instance for Movim.

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial Movim deployment"
    git remote add origin https://github.com/yourusername/movim-deploy.git
    git push -u origin main

    Create 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:

    • Select HTTP as the traffic type
    • Set the internal port to 8080

    Set Environment Variables

    Configure your environment:

    VariableValue
    MOVIM_DOMAINyour-app-name.klutch.sh
    MOVIM_DB_HOSTYour PostgreSQL host
    MOVIM_DB_NAMEmovim
    MOVIM_DB_USERYour database user
    MOVIM_DB_PASSWORDYour database password

    Attach Persistent Volumes

    Add volumes for persistent data:

    Mount PathRecommended SizePurpose
    /var/www/movim/cache10 GBMedia cache
    /var/www/movim/log1 GBApplication logs

    Deploy Your Application

    Click Deploy to build and launch Movim.

    Run Database Setup

    Initialize the database:

    Terminal window
    php vendor/bin/phinx migrate

    Access Movim

    Navigate to https://your-app-name.klutch.sh.

Using Movim

Creating an Account

  1. Navigate to your Movim instance
  2. Click Create an account or Log in
  3. Enter your XMPP credentials (user@domain.com)
  4. 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:

  1. Click Write or the compose button
  2. Add text, images, or videos
  3. Select visibility (public, contacts, private)
  4. Publish

Messaging

Start conversations:

  1. Click Chats in navigation
  2. Select a contact or start new chat
  3. Send messages, files, and stickers
  4. Make audio/video calls

Communities

Join and participate in groups:

  1. Navigate to Explore
  2. Browse or search communities
  3. Subscribe to interesting groups
  4. Post and interact with members

Configuration

XMPP Server Whitelist

Restrict which XMPP servers users can log in from:

MOVIM_XMPP_WHITELIST=yourdomain.com,partner.com

Admin Configuration

Set administrator accounts:

MOVIM_ADMIN=admin@yourdomain.com

Admins 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:

  1. Access admin panel
  2. Navigate to Customization
  3. Set logo and colors
  4. 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

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.