Skip to content

Deploying LibreServer

Introduction

LibreServer (formerly Freedombone) is a self-hosted home server system designed to give individuals and small organizations control over their digital lives. Rather than relying on cloud services from large corporations, LibreServer enables you to run your own email, social networking, file storage, chat, and many other services on hardware you control.

Built on Debian, LibreServer provides a curated collection of privacy-focused applications that are pre-configured to work together securely. The project emphasizes ease of use, security by default, and freedom from surveillance capitalism.

Key highlights of LibreServer:

  • Email Server: Full-featured email with spam filtering and encryption
  • XMPP Chat: Secure instant messaging with OMEMO encryption
  • Matrix/Element: Modern chat with federation support
  • Nextcloud: File sync and collaboration
  • ActivityPub: Federated social networking
  • RSS Reader: Stay updated without tracking
  • CalDAV/CardDAV: Calendar and contacts sync
  • Git Hosting: Self-hosted code repositories
  • VPN: Secure remote access
  • Tor Support: Optional onion services
  • Web Interface: Manage services through a control panel

This guide walks through deploying LibreServer components on Klutch.sh using Docker.

Why Deploy LibreServer on Klutch.sh

Deploying LibreServer components on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically builds your LibreServer setup. Push to GitHub, and services deploy automatically.

Persistent Storage: Attach persistent volumes for email, files, and databases. Your data survives restarts.

HTTPS by Default: Klutch.sh provides automatic SSL certificates for all services.

GitHub Integration: Connect your repository for automatic redeployments.

Scalable Resources: Allocate resources based on your usage patterns.

Environment Variable Management: Securely store configuration and secrets.

Custom Domains: Essential for email and federation features.

Always-On Availability: Your personal services remain accessible 24/7.

Prerequisites

Before deploying LibreServer on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • A custom domain with full DNS control
  • Understanding of the services you want to run
  • (Optional) Additional domains for service separation

Understanding LibreServer Architecture

LibreServer is a collection of services:

Control Panel: Web interface for managing installed services.

Service Containers: Each service (email, chat, etc.) runs independently.

Database Layer: PostgreSQL/MariaDB for services requiring databases.

Reverse Proxy: Handles routing and SSL termination.

Mail Server: Postfix/Dovecot stack for email.

Authentication: Centralized user management.

Preparing Your Repository

Repository Structure

libreserver-deploy/
├── Dockerfile
├── docker-compose.yml
├── README.md
└── .dockerignore

Creating the Dockerfile

For a core LibreServer-style deployment:

FROM debian:bookworm-slim
# Install base packages
RUN apt-get update && apt-get install -y \
curl \
git \
nginx \
certbot \
python3-certbot-nginx \
supervisor \
&& rm -rf /var/lib/apt/lists/*
# Create directories
RUN mkdir -p /var/lib/libreserver /var/log/libreserver
# Environment configuration
ENV DOMAIN=${DOMAIN:-example.com}
ENV ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
# Copy configuration files
COPY supervisord.conf /etc/supervisor/conf.d/
# Expose ports
EXPOSE 80 443
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost/ || exit 1
CMD ["/usr/bin/supervisord", "-n"]

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Environment Variables Reference

VariableRequiredDefaultDescription
DOMAINYes-Primary domain for services
ADMIN_EMAILYes-Administrator email address
ADMIN_PASSWORDYes-Administrator password

Deploying LibreServer on Klutch.sh

    Plan Your Services

    Decide which LibreServer components you need:

    • Email (requires proper DNS records)
    • Chat (XMPP or Matrix)
    • File storage (Nextcloud)
    • Social networking (ActivityPub)

    Configure DNS

    Set up required DNS records:

    • A/AAAA records for your domain
    • MX records for email
    • SRV records for chat protocols
    • SPF/DKIM/DMARC for email authentication

    Push Your Repository to GitHub

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

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “libreserver” or “homeserver”.

    Create Apps for Each Service

    Deploy each component as a separate app:

    • Main web server/control panel
    • Email server (if applicable)
    • Chat server
    • File storage

    Configure HTTP Traffic

    For each app:

    • Select HTTP as the traffic type
    • Set appropriate ports

    Set Environment Variables

    Add configuration for each service:

    VariableValue
    DOMAINYour primary domain
    ADMIN_EMAILYour admin email
    ADMIN_PASSWORDSecure admin password

    Attach Persistent Volumes

    Mount PathRecommended SizePurpose
    /var/lib/libreserver50+ GBService data
    /var/mail20+ GBEmail storage
    /var/log/libreserver5 GBLogs

    Deploy Your Applications

    Click Deploy for each service component.

    Configure Services

    Access the control panel and configure each service according to your needs.

Initial Configuration

Control Panel Setup

Access the management interface:

  1. Navigate to your deployment URL
  2. Log in with admin credentials
  3. Review installed services
  4. Enable desired features

Email Configuration

Set up your mail server:

  1. Verify DNS records are correct
  2. Configure mail domains
  3. Create user accounts
  4. Test sending and receiving

Chat Setup

Configure instant messaging:

  1. Choose XMPP or Matrix
  2. Set up user accounts
  3. Configure federation if desired
  4. Install client apps

File Storage

Set up Nextcloud or similar:

  1. Create user accounts
  2. Configure storage quotas
  3. Set up sync clients
  4. Enable desired apps

Production Best Practices

Security Recommendations

  • Use strong passwords for all accounts
  • Enable two-factor authentication where available
  • Keep all services updated
  • Monitor logs for suspicious activity
  • Use Tor for additional privacy if needed

Email Deliverability

  • Set up SPF records correctly
  • Configure DKIM signing
  • Implement DMARC policies
  • Maintain good sending reputation

Backup Strategy

  1. Back up all service data regularly
  2. Export email to external storage
  3. Back up encryption keys securely
  4. Test restore procedures

Troubleshooting

Email Issues

  • Verify DNS records with online tools
  • Check spam folder on receiving end
  • Review mail server logs
  • Test with mail-tester.com

Federation Problems

  • Verify DNS and SSL configuration
  • Check firewall allows required ports
  • Review federation logs
  • Test with federation testers

Service Not Starting

  • Check resource allocation
  • Review service logs
  • Verify configuration files
  • Ensure dependencies are running

Additional Resources

Conclusion

Deploying LibreServer components on Klutch.sh enables you to take control of your digital life with self-hosted services for email, chat, file storage, and more. While running your own infrastructure requires more effort than using commercial services, the privacy and control benefits are significant.

With Klutch.sh handling the deployment complexity, you can focus on configuring and using your personal cloud services.