Install Movim

Jaussoin Timothée edited this page Sep 8, 2018 · 57 revisions

This tutorial describes the different steps you need to take to deploy Movim on your webserver. It can be followed from version 0.9 (included).


Movim requires some dependencies to be setup properly.

  • A fully working webserver like Apache or Nginx (version 1.3.13 minimal)
  • A PHP process manager like php-fpm will usually be required for Nginx
  • Root access by SSH with access to the webserver user (most of the time via the user www-data)
  • A SQL server with a schema for Movim (more info in Database Configuration).
    • PotgreSQL (strongly recommended)
    • MySQL 5.7 or higher with utf8mb encoding
    • MariaDB 10.2 or higher with utf8mb encoding
    • SQLite3
  • PHP 7.0 minimum with :
    • Curl (package ''php-curl'')
    • PHP mbtring (package ''php-mbstring'')
    • PHP ImageMagick and GD for the picture processing (package ''php-imagick'' and ''php-gd'')
    • Your database PHP driver (package ''php-pgsql'' or ''php-mysql'' depending on the type of database server you want to use).
    • PHP ZeroMQ (package ''php-zmq'')
    • And the PHP XML (package ''php-xml'')

General behaviour

It's mandatory to understand the general architecture of the project to a certain extent before trying to deploy it.

When you use Movim, it acts as an intermediary between the user's browser and an XMPP server. All the data that is sent and received by these two parties are managed by the Movim core, some of them are also saved in a database (for cache purposes).

From the browser perspective, all communication with Movim is done using WebSockets (except for the "default" page loading). These sockets are proxied through your web-server to the Movim daemon. On the XMPP side Movim connects using pure TCP connections (like any XMPP client).

So all these streams will be managed by the Movim daemon. This daemon needs to be launched with the same user and rights as the web-server (most of the time using the www-data user).


Stable version

The Movim source code is not available in a packaged version for now, please follow the next paragraph.

Development version (repository)

The development version of Movim only comes with the core of the project. To install the dependencies you need to install Git to download the source codes from different repositories.

# Install Git so that Composer 
# can clone the dependencies into your project
apt-get install git


Git is required to properly get the source code from the official repository. We recommend to execute the following commands with the www-data user (which is the common user for most of the GNU/Linux web servers).

cd /var/www/ # Server directory
sudo -s -u www-data # We use the web-server user
# We copy the source code from the repository
git clone

Dependency installation

Movim requires several dependencies to work properly. These libraries are managed using Composer. You can install Composer in the Movim directory using the following command.

curl -sS | php

Now you will be able to install the dependencies.

# Finally install your project's dependencies
php composer.phar install


You can also update your current Movim instance with the following lines (check anyway if the updates do not include any incompatibilities with your current version).

cd /var/www/movim/
git pull # To update the Movim source-code
php composer.phar install # To update the libraries

If the update comes with some database changes you can run the new migrations (see bellow).


This part of the tutorial can be followed for the stable and testing installation. They need to be applied in the correct order.

1. Rights check

Movim needs reading permissions on its root folder and recursively to be deployed properly. It will also try to create two folders:

  • log/ for the PHP logs
  • cache/ for the thumbnails and some temporary files

You can create the folders in advance and it will skip this step, or you can let it by giving it writing permissions on its root folder:

# Use the root user to do the command
chown www-data movim && chmod u+rwx movim

2. Database Configuration

Movim needs to be connected to an existing database to work properly. The minimal required schema is therefore an empty database associated with a user. The default configuration file uses the following values:

# If using SQLite, only 'type' and 'database' are needed
$conf = [
    # The type can be 'pgsql', 'mysql' or 'sqlite'
    'type'        => 'pgsql',
    # The database username
    'username'    => 'username',
    # The password
    'password'    => 'password',
    # Where can we find the database ?
    'host'        => 'localhost',
    # The port number, 5432 for PostGreSQL and 3306 for MySQL
    'port'        => 5432,
    # The database name, or for SQLite the absolute file path
    'database'    => 'movim'

It is not advised to keep the same values when you go to production, rename the example file in the config folder to and fill the fields with your personal configuration.

cd movim/config/
# Edit with your current configuration

Once the database is setup create the database structure using Phinx.

php vendor/bin/phinx migrate

Migrating from Movim 0.13.* and bellow

Until version 0.13.* Movim was relying on Modl. The version 0.14+ is now relying on Eloquent for the database manipulations. Movim is coming with a script to migrate easily between those two releases. Run it using.

php vendor/bin/phinx migrate
php vendor/bin/phinx seed:run -s FromModlToEloquent

3. Start the daemon

To let the browser communicate with the Movim server, you need to launch the daemon. It also needs to be launched using the web server user.

sudo -s -u www-data # if you are on Ubuntu

Then launch the daemon with two mandatory parameters:

  • The public URL of Movim. For the official pod it is, for a test on your own machine it could also be http://localhost/movim/. Don't forget to add the S of HTTPS in your URL if it is enabled on your side.
  • The port used by the daemon, 8080 in our case.
cd /var/www/movim
# we launch the daemon
php daemon.php start --url={public url of your pod} --port={port used by the daemon} 

You can also enable the verbose (--verbose or -v) and/or debug (--debug or -d enable the XMPP logs) options of the daemon to investigate on possible issues.

If everything runs as expected you should see:

Movim daemon launched
Base URI :
Encrypted Public WebSocket URL : wss://

This daemon will be killed once your console is closed. Consider using systemd or init scripts to keep the daemon running in the foreground even after your disconnection. There are example startup files, like a systemd service file, in the etc/ directory.

4. Configure your web server

When you launch the daemon, it will generate the configuration to apply to your web server to "proxify" the WebSockets and display it in the console.

These configurations are dynamically generated to fit your current setup. Whether you use Apache or Nginx, both possible configuration will be displayed and will display even after you successfully applied them.

Here is an example of generated configuration:

For Apache

Enable the Proxy WebSocket module.

# a2enmod proxy_wstunnel 

Add this in your configuration file (default-ssl.conf)

ProxyPass /ws/ ws://localhost:8080/

Note that default-ssl.conf is the file to edit if you enabled HTTPS, otherwise you should edit 000-default.conf. Also remember to restart Apache to make sure your new configuration has been applied correctly.

For Nginx

Add the following configuration

location /ws/ {
    proxy_pass http://localhost:8080/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect off;

5. Admin panel

Now that everything is setup, you can configure Movim using the Admin Panel at {your public domain}/?admin, so if you're on your local host:


The default credentials are admin and password. This page will also let you reset these values to more secure ones.

Note: This has been changed in b6952af5 (master), there are no default credentials anymore. Please use php daemon.php config --username=FOO --password=BAR to set the credentials.

Some of the configuration elements are only applied after the reboot of the daemon.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.