Home Installation Features Fediverse Configuration Terms Privacy Legal
Language / Langue
v2.4

Documentation

Installation and deployment guide for MILITANT, the self-managed militant social network.

Installation & Deployment

Development (Local)

To contribute or test with dev tools (Mailpit, Hot-reload...):

git clone https://gitlab.com/militant1/millitant.git
cd millitant
docker compose up -d --build

Guided Installation (Recommended)

The simplest way to deploy the main web app with the official pre-built image.

1. Download the required files:

mkdir militant-install
cd militant-install
curl -fsSLO https://gitlab.com/militant1/militant-server-installer/-/raw/main/militant
curl -fsSLO https://gitlab.com/militant1/millitant/-/raw/main/docker-compose.prod.yml
curl -fsSLO https://gitlab.com/militant1/millitant/-/raw/main/.env.template
chmod +x militant

2. Run the installer:

./militant

The script creates .env automatically, fetches the main web app Docker image, validates the configuration, can enable fail2ban and real client IP via proxy, then starts docker compose.

Manual Compose Deployment

Alternative if you prefer to manage the .env file yourself.

1. Download files:

curl -O https://gitlab.com/militant1/millitant/-/raw/main/docker-compose.hosting.yml
curl -O https://gitlab.com/militant1/millitant/-/raw/main/.env.template

2. Configure:

cp .env.template .env
nano .env # Fill in your credentials (DB, SMTP...)

3. Launch:

docker compose -f docker-compose.hosting.yml up -d

Minimal Variant

You can also use the production compose file directly:

1. Download files:

curl -O https://gitlab.com/militant1/millitant/-/raw/main/docker-compose.prod.yml
curl -O https://gitlab.com/militant1/millitant/-/raw/main/.env.template

2. Configure:

cp .env.template .env
nano .env # Fill in your credentials (DB, SMTP...)

3. Launch:

docker compose -f docker-compose.prod.yml up -d

Advanced Network Configuration

If you use Cloudflare or a reverse proxy, MILITANT automatically detects the real IP of your users.

All Apache configuration (`mod_remoteip`) is handled by our hot update script.

# Apply Cloudflare config to your server
sudo ./hot_update.sh

Installation via CasaOS

  1. Open App Center then click on Custom Install (top right)
  2. Click on the Docker Compose icon (top right of the modal)
  3. Paste the content of the docker-compose.casaos.yml file
  4. Click on Install
  5. Access http://CASAOS-IP:8080
  6. Create the admin account: http://CASAOS-IP:8080/setup_admin.php

System Requirements: ~512 MB RAM minimum, ~5 GB disk (depending on uploads)

🛡️ Fail2Ban Protection

Fail2Ban is enabled by default on CasaOS to protect against brute force attacks by banning IPs after several failed attempts.

Check Status

# Check if Fail2Ban is running
docker ps | grep fail2ban

# Jail status
docker exec militant-fail2ban fail2ban-client status

# Details of the militant-auth jail
docker exec militant-fail2ban fail2ban-client status militant-auth

Default Configuration

Parameter Value
Max attempts 5
Ban duration 1 hour
Detection window 5 minutes

💾 Automatic Backup

Automatically backup your instance (code + database) to Docker Hub.

Run a Manual Backup

sudo /usr/local/bin/militant-backup.sh

Note: Weekly backups are configured via cron on Sundays at 3 AM.

🏥 Health Check Endpoints

MILITANT exposes health endpoints to monitor service status in real-time.

Public Endpoints (Status Page)

These endpoints are publicly accessible and do not reveal any sensitive information:

https://militant.revlibertaire.com/health-public.php
https://api.militant.revlibertaire.com/health-public.php

JSON Response:

{
  "status": "ok",
  "timestamp": 1771206234
}

Possible Values:

  • ok - Service operational ✅
  • degraded - Service degraded ⚠️
  • partial_outage - Partial outage 🔴

Private Endpoints (Internal Monitoring)

These endpoints are restricted to local access (localhost and internal networks) and provide infrastructure details:

https://militant.revlibertaire.com/health.php
https://api.militant.revlibertaire.com/health.php

Detailed Response (localhost only):

{
  "status": "ok",
  "timestamp": 1771206234,
  "services": {
    "database": "ok",
    "storage": "ok",
    "php": "ok"
  }
}

External Access:

{
  "error": "Access denied",
  "status": "forbidden"
}

Security: Private endpoints only accept connections from 127.0.0.1, ::1 and private networks (10.x.x.x, 172.16-31.x.x, 192.168.x.x).

Public Status Page

Check service status in real-time:

https://militant.revlibertaire.com/status.html

The page automatically queries public endpoints every 30 seconds.

Features

Security & Account

  • Two-factor authentication (2FA) via TOTP (Google Authenticator, Authy...)
  • Passkeys (WebAuthn): Biometric login (fingerprint, face)
  • Passwords hashed with Argon2ID
  • Integrated Fail2Ban (anti-brute force protection)
  • Strict CSRF, XSS, and Rate Limiting protection

Posts

  • Posts with photos/videos (up to 500MB)
  • Rich Link Previews (automatic link previews)
  • Emoji reactions
  • Nested comments with replies
  • @mentions with notifications

Social

  • Private messages with basic encryption
  • Fleeting stories (24h) with touch navigation
  • Chronological "For You" / "Subscriptions" feed
  • Friends and followers system
  • Unified global search

Groups & Collectives (Messaging V2)

A complete integrated instant messaging system, designed for collective organization.

  • Horizontal Governance: All members are admins by default. Collegiate management of members and settings.
  • Ephemeral Messages: Set up automatic self-destruction (from 1 minute to 7 days) for your sensitive discussions.
  • Audio & Media: Direct voice recording (iOS/Android compatible), photo and video sharing with integrated lightbox.
  • Secure Exchanges: Strict isolation of messaging data and alerts in case of session hijacking attempts.
  • Membership Requests: Validation system for private groups with customizable questionnaires.

Internationalization

  • Interface translated into French, English, Spanish, Esperanto
  • Automatic translation of posts and messages (LibreTranslate)
  • Automatic language detection

Federation (Fediverse)

MILITANT is connected to the Fediverse! Interact with users of Mastodon, Bluesky, and other decentralized platforms directly from your network.

  • Follow remote accounts easily via handle search
  • A dedicated federated feed to follow updates from external subscriptions
  • Asynchronous sharing for seamless interoperability with other servers

📱 Mobile Interface

An experience natively optimized for smartphones without an extra application.

  • Bottom navigation bar: Quick access to Home, Search, Messages, Profile.
  • Offcanvas Menu: Lateral access to all advanced features.
  • Adaptive Header: Logo and essential actions always visible.
  • PWA Badge: Native notification support on Android.

Configuration (.env)

Variable Description Default (Dev)
DB_HOST MySQL Host db
DB_NAME Database Name militant
DB_USER MySQL User militant
DB_PASS MySQL Password militant123
SMTP_HOST SMTP Server mailpit
SMTP_PORT SMTP Port 1025
APP_URL Public URL http://localhost:9000
HCAPTCHA_SITE_KEY hCaptcha Site Key -
HCAPTCHA_SECRET_KEY hCaptcha Secret Key -

Collective Moderation

No hierarchy. Decisions by consensus.

  • Reports processed by collective vote
  • 70% consensus required
  • Moderators elected and revocable by all

Languages

Available in: French, English, Spanish, Esperanto

Add a language: create lang/xx.php

PWA Application

MILITANT is a Progressive Web App (PWA) installable on mobile and desktop. It even works offline.

On Android

  1. Open militant.revlibertaire.com in Chrome
  2. Tap the menu (three dots at the top right)
  3. Select "Add to Home Screen"
  4. Confirm by tapping "Add"
  5. The MILITANT icon appears on your home screen

On iPhone / iPad

  1. Open militant.revlibertaire.com in Safari
  2. Tap the Share button (at the bottom of the screen)
  3. Scroll down and select "Add to Home Screen"
  4. Tap "Add" at the top right
  5. The MILITANT icon appears on your home screen

On Computer (Chrome, Edge)

  1. Open militant.revlibertaire.com
  2. Click the installation icon in the address bar
  3. Or go to the menu "Install MILITANT"
  4. The application opens in its own window

PWA Advantages: Quick access from the home screen, push notifications, works offline, no need to go through a store.