Skip to content

Deploying Citadel

Citadel is a powerful, feature-rich, 100% open-source email, collaboration, and groupware platform that runs on your own hardware or in the cloud. Built with a unique “rooms-based” architecture, Citadel seamlessly integrates email, calendaring, address books, bulletin boards, instant messaging, wiki engines, blog functionality, mailing list servers, RSS aggregation, and content management into a single unified platform. Easy to install and maintain, Citadel requires no licensing fees and gives you complete control over your communication infrastructure. Whether you’re a small organization needing email and basic collaboration, or an enterprise requiring a full-featured groupware solution, Citadel provides powerful, flexible communication capabilities with zero vendor lock-in.

This comprehensive guide walks through deploying Citadel to Klutch.sh using a Dockerfile for reliable, containerized deployment. You’ll learn how to set up Citadel with persistent data storage, create a production-ready Dockerfile, configure the web interface, set up email services, manage calendars and address books, implement security best practices, configure SSL/TLS encryption, set up backups, configure custom domains, monitor system health, and troubleshoot common issues. By the end of this guide, you’ll have a production-ready Citadel server running on Klutch.sh’s global infrastructure with automatic HTTPS, optimized performance, and reliable hosting.

Prerequisites

  • Linux OS knowledge: Understanding of Linux concepts and package management
  • Docker installed locally (for testing Dockerfiles, optional but recommended)
  • Git installed locally and a GitHub account (Klutch.sh uses GitHub as the only git source)
  • Klutch.sh account with access to the dashboard at klutch.sh/app
  • Text editor or IDE for code editing (VS Code recommended)
  • Basic networking knowledge: Understanding of email protocols, DNS, and firewall rules
  • 25+ GB storage minimum for email data and messages (adjust based on expected users)

Understanding Citadel Architecture

Key Components

Citadel Server (citserver):

  • Core backend server handling email, messaging, and data storage
  • Manages user accounts and permissions
  • Implements the “rooms” architecture
  • Handles IMAP, POP3, SMTP protocols
  • Stores all data in its native database format

Citadel Web Interface (webcit):

  • Modern web-based client for Citadel
  • Access email, calendar, contacts, forums via browser
  • Responsive design works on mobile and desktop
  • Real-time notifications and updates

Database Layer:

  • Citadel uses its own embedded database (optional Berkeley DB or SQLite)
  • Stores user accounts, messages, calendar events, settings
  • Designed for high reliability and data integrity

Architecture Features

  • Rooms-based system: Everything (email, forums, calendars) is organized in “rooms”
  • Multi-domain support: Host email for multiple domains on single server
  • User hierarchy: Administrators, room aides, regular users, guest accounts
  • Access controls: Granular permissions at room and user levels
  • Extensible: Support for plugins and custom configurations

Project Setup

1. Create Project Directory

Create a project directory for your Citadel deployment:

Terminal window
mkdir citadel-deployment
cd citadel-deployment
git init

2. Create a .gitignore File

Create .gitignore to exclude unnecessary files:

.env.local
.env.*.local
*.log
*.swp
.DS_Store
.vscode
.idea
citadel-data/
backup/
tmp/

3. Create Directory Structure

Create the necessary directory structure:

Terminal window
mkdir -p {citadel-data,config,backup,scripts}
# Create directory structure

The project structure will look like:

citadel-deployment/
├── Dockerfile
├── docker-compose.yaml (for local testing)
├── entrypoint.sh
├── config/
│ └── citadel.conf (configuration template)
├── scripts/
│ └── init-citadel.sh
├── citadel-data/ (persistent data, mounted as volume)
├── backup/ (local backup directory)
├── .dockerignore
├── .gitignore
└── README.md

4. Create .dockerignore File

Create .dockerignore to exclude files from Docker build:

.git
.gitignore
*.log
.env.local
citadel-data/
backup/
tmp/
.DS_Store
.vscode
.idea
docker-compose.yaml

Creating a Production Dockerfile

Create a Dockerfile for production deployment:

# === Base Stage ===
FROM debian:12-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libexpat-dev \
libcurl4-openssl-dev \
pkg-config \
curl \
wget \
ca-certificates \
procps \
openssh-client \
git \
nano \
&& rm -rf /var/lib/apt/lists/*
# Create citadel user and group
RUN groupadd -r citadel && useradd -r -g citadel citadel
# Set working directory
WORKDIR /tmp/citadel-build
# Download and compile Citadel from source
RUN curl -L https://github.com/citadel/citadel/archive/refs/heads/master.zip -o citadel.zip && \
unzip citadel.zip && \
cd citadel-master && \
./configure --prefix=/usr/local/citadel \
--with-db=builtin \
--enable-http \
--enable-smtp \
--enable-imap && \
make && \
make install && \
cd / && \
rm -rf /tmp/citadel-build
# Create data directory
RUN mkdir -p /var/lib/citadel && \
chown -R citadel:citadel /var/lib/citadel && \
chmod 700 /var/lib/citadel
# Create log directory
RUN mkdir -p /var/log/citadel && \
chown -R citadel:citadel /var/log/citadel
# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Expose ports
# 80 - HTTP (webcit web interface)
# 443 - HTTPS (webcit web interface)
# 25 - SMTP (mail submission)
# 110 - POP3 (mail retrieval)
# 143 - IMAP (mail retrieval)
# 389 - LDAP (directory services, if enabled)
EXPOSE 80 443 25 110 143
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost/ || exit 1
# Set user
USER citadel
# Entrypoint
ENTRYPOINT ["/entrypoint.sh"]

Dockerfile Explanation

  • Base image: Debian 12 slim for minimal size and compatibility
  • Build dependencies: Essential tools for compiling Citadel from source
  • Source compilation: Builds Citadel with HTTP, SMTP, and IMAP support
  • Data persistence: /var/lib/citadel directory for persistent data
  • Multi-protocol support: SMTP, POP3, IMAP, HTTP/HTTPS, LDAP
  • Health checks: Automatic container health monitoring
  • Non-root user: Runs as citadel user for security
  • Port exposure: All necessary Citadel ports exposed

Create Entrypoint Script

Create entrypoint.sh for container initialization:

#!/bin/bash
set -e
# Function to log messages
log() {
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"
}
log "Starting Citadel initialization..."
# Check if data directory is empty (first run)
if [ ! -f /var/lib/citadel/citadel.config ]; then
log "First run detected. Initializing Citadel..."
# Create directory structure
mkdir -p /var/lib/citadel
mkdir -p /var/log/citadel
# Run Citadel setup
/usr/local/citadel/bin/citserver -x
log "Citadel initialization complete"
else
log "Existing Citadel installation found"
fi
log "Starting Citadel server..."
# Start Citadel server in foreground
exec /usr/local/citadel/bin/citserver -x

Building the Dockerfile Locally (Optional)

Test the Dockerfile locally:

Terminal window
# Build the Docker image
docker build -t citadel:latest .
# Run the container locally (for testing only)
docker run -d \
--name citadel-test \
-p 8080:80 \
-p 25:25 \
-p 110:110 \
-p 143:143 \
-v citadel-data:/var/lib/citadel \
citadel:latest
# Wait for container to start
sleep 30
# Access web interface
# http://localhost:8080

Deploying with Docker on Klutch.sh

Klutch.sh automatically detects a Dockerfile in your repository root and uses it for deployment. This provides control over your environment.

Prerequisites for Docker Deployment

  • Your Citadel project pushed to a GitHub repository with Dockerfile
  • Understanding of Citadel’s port requirements
  • Planned storage requirements (minimum 25 GB recommended)

Steps to Deploy with Docker

  1. Prepare Your Repository

    Create and commit all necessary files:

    Terminal window
    git add Dockerfile entrypoint.sh .dockerignore
    git commit -m "Add Docker deployment configuration for Citadel"
    git push origin main
  2. Log In to Klutch.sh Dashboard

    Go to klutch.sh/app and sign in with your GitHub account.

  3. Create a Project

    Navigate to the Projects section and create a new project for your Citadel installation.

  4. Create an App

    Click “Create App” and select your GitHub repository containing the Citadel Docker configuration.

  5. Select the Branch

    Choose the branch you want to deploy (typically main).

  6. Configure Traffic Type**

    Citadel requires multiple protocols. Configure as follows:

    Primary App (Web Interface):

    • Select HTTP as the traffic type
    • Internal port: 80

    Note: You may need to create separate “apps” for SMTP/POP3/IMAP depending on Klutch.sh’s capabilities, or use your domain’s mail routing if you have direct server access.

  7. Add Environment Variables**

    Configure environment variables for your Citadel instance:

    CITADEL_ADMIN_USER=admin
    CITADEL_ADMIN_PASS=secure_admin_password_change_me
    CITADEL_HOSTNAME=example-app.klutch.sh
    CITADEL_IPADDR=127.0.0.1
    CITADEL_SMTP_PORT=25
    CITADEL_IMAP_PORT=143
    CITADEL_POP3_PORT=110
    CITADEL_HTTP_PORT=80
    CITADEL_HTTPS_PORT=443
    TZ=UTC
  8. Configure Persistent Storage**

    Citadel stores all email, calendar, and user data in /var/lib/citadel. This must be a persistent volume:

    1. After creating the app, go to Volumes
    2. Click Add Volume
    3. Mount path: /var/lib/citadel
    4. Size: 25-100 GiB (adjust based on expected users and email volume)
    5. Save and note the mount path

    Also add a volume for logs (optional but recommended):

    1. Mount path: /var/log/citadel
    2. Size: 5-10 GiB
  9. Configure Compute Resources**

    Select appropriate resources:

    • Minimum: 2 CPU, 2 GB RAM (small organization, <50 users)
    • Recommended: 4 CPU, 4-8 GB RAM (medium organization, 50-500 users)
    • Large: 8+ CPU, 16+ GB RAM (large organization, 500+ users)

    Select region closest to your users.

  10. Deploy**

    Click “Create” to start the deployment. Klutch.sh will:

    1. Build the Docker image from your Dockerfile
    2. Start the Citadel container
    3. Assign a public URL (e.g., example-app.klutch.sh)
    4. Configure HTTPS automatically
  11. Complete Citadel Setup**

    After deployment, access the web interface:

    1. Navigate to https://example-app.klutch.sh
    2. Log in with the admin credentials (if first run)
    3. Complete the initial setup wizard:
      • Configure site name and description
      • Set up default mail domain
      • Configure administrator account
      • Enable/disable services (IMAP, POP3, SMTP, etc.)
      • Set timezone and language preferences
  12. Configure Mail Domain**

    To enable email functionality:

    1. In Citadel admin panel, add your mail domain
    2. Configure DNS MX records pointing to your server
    3. Set up SPF, DKIM, DMARC records for email authentication

    Example DNS configuration:

    MX: 10 example-app.klutch.sh
    SPF: "v=spf1 ip4:your.server.ip -all"

    Note: Klutch.sh may require special configuration for direct mail port access. Contact support for mail server setup.

  13. Set Up SSL/TLS Certificates**

    Klutch.sh automatically provides HTTPS for your web interface. For SMTP/IMAP/POP3, Citadel can generate self-signed certificates or use Let’s Encrypt.

    In Citadel admin panel:

    1. Go to System AdministrationNetwork Configuration
    2. Configure certificate paths
    3. Enable TLS for mail protocols

Citadel Features and Configuration

1. Email Services

Citadel provides complete email functionality:

SMTP (port 25):

  • Mail submission and relay
  • Authentication required for outbound mail
  • Support for mail forwarding

IMAP (port 143):

  • Full IMAP4 compliance
  • Support for flags, folders, and IDLE
  • Enables Thunderbird, Outlook, mobile clients

POP3 (port 110):

  • Traditional POP3 support
  • Synchronization with web interface
  • Leave-on-server option

Configure in admin panel:

  1. Go to System AdministrationMail Configuration
  2. Enable desired protocols
  3. Set port numbers and TLS requirements

2. Calendar and Scheduling

Citadel includes integrated calendar functionality:

Features:

  • Create and manage multiple calendars per user
  • Appointment scheduling with notifications
  • iCalendar format support
  • Calendar sharing with other users
  • Recurring events and reminders

Access calendar:

  1. Log in to web interface
  2. Click Calendar in the sidebar
  3. Create events or import from ICS files

3. Address Books and Contacts

Integrated contact management:

Features:

  • Personal contact lists
  • Organization-wide directory
  • LDAP directory service support
  • vCard import/export
  • Contact groups and distribution lists

4. Discussion Boards and Forums

Built-in forum capabilities:

Features:

  • Create public or private discussion rooms
  • Topic-based organization
  • User moderation tools
  • Threaded conversations
  • File attachments in posts

Create a forum:

  1. Go to RoomsCreate New Room
  2. Select “Discussion Forum” type
  3. Configure access controls
  4. Start discussions

5. Instant Messaging

Real-time communication:

Features:

  • One-on-one messaging
  • Group chat rooms
  • User presence indicators
  • Message history
  • Integration with calendar availability

6. Wiki and Blog Engines

Content publishing:

Wiki Features:

  • Collaborative wiki pages
  • Revision history
  • Link to external resources
  • Page hierarchy

Blog Features:

  • Personal blogs
  • Post scheduling
  • Comments and discussion
  • Categories and tags

7. Mailing List Server

Full-featured mailing list management:

Features:

  • List creation and management
  • Moderation tools
  • Automatic digest generation
  • Bounced mail handling
  • Subscription management

Persistent Storage

Citadel requires persistent storage for:

Critical Data Directories

/var/lib/citadel/
├── citadel.config (configuration)
├── data/ (user data, messages, calendar events)
├── messages/ (email messages)
├── userdata/ (user profiles and settings)
└── attachments/ (file attachments)
/var/log/citadel/
└── citadel.log (server logs)

Adding Persistent Volumes

  1. In Klutch.sh dashboard, go to your Citadel app
  2. Navigate to Volumes section
  3. Add volume for /var/lib/citadel:
    • Mount path: /var/lib/citadel
    • Size: 25-100 GiB (depending on users and email volume)
  4. Optionally add volume for /var/log/citadel:
    • Mount path: /var/log/citadel
    • Size: 5-10 GiB

Backup Strategy

Implement regular backups:

#!/bin/bash
# Daily backup script
BACKUP_DIR="/backups/citadel"
DATE=$(date +%Y%m%d_%H%M%S)
RETENTION_DAYS=30
# Create backup directory
mkdir -p $BACKUP_DIR
# Backup Citadel data
tar -czf $BACKUP_DIR/citadel_data_$DATE.tar.gz /var/lib/citadel/
# Backup logs
tar -czf $BACKUP_DIR/citadel_logs_$DATE.tar.gz /var/log/citadel/
# Delete old backups (older than retention period)
find $BACKUP_DIR -name "citadel_*" -mtime +$RETENTION_DAYS -delete
# Upload to remote storage
# aws s3 sync $BACKUP_DIR s3://my-backup-bucket/citadel/

Security Best Practices

1. HTTPS/SSL Enforcement

Klutch.sh automatically provides HTTPS for the web interface. For mail protocols:

  1. In Citadel admin panel, enable TLS for IMAP, POP3, SMTP
  2. Configure certificate paths
  3. Require TLS for client connections

2. User Authentication

Implement strong authentication:

Password Requirements:
- Minimum 8 characters
- Mix of uppercase, lowercase, numbers, special characters
- No dictionary words
- Regular password rotation (90 days recommended)

Enable in admin panel:

  1. Go to System AdministrationUser Management
  2. Set password policies
  3. Enable account lockout after failed attempts

3. Firewall and Access Control

Configure room access controls:

Room Types:

  • Public: Visible to all, anyone can join
  • Guessable: Not listed, but discoverable if you know the name
  • Invitation Only: Private rooms for selected users
  • Hidden: Completely private, invitation required

4. Email Authentication

Implement email security standards:

SPF (Sender Policy Framework):

v=spf1 ip4:your.server.ip include:citadel.example.com -all

DKIM (DomainKeys Identified Mail):

  1. Generate DKIM keys in Citadel
  2. Publish to DNS TXT records
  3. Enable DKIM signing

DMARC (Domain-based Message Authentication):

v=DMARC1; p=quarantine; rua=mailto:admin@example.com

5. Regular Updates

Keep Citadel updated:

  1. Monitor Citadel releases
  2. Test updates in staging environment first
  3. Rebuild Docker image with new version
  4. Redeploy via Klutch.sh

6. Database Security

Citadel uses embedded database with built-in security:

  • Data encrypted at rest
  • Access controls per user
  • Automatic integrity checking
  • Transaction logging

7. Admin Account Security

Protect your administrator account:

  • Change default admin password immediately
  • Create dedicated admin account
  • Disable unused admin accounts
  • Enable audit logging for admin actions
  • Implement IP whitelisting for admin access (if possible)

8. Network Security

Implement firewall rules:

Allow inbound:
- Port 80 (HTTP)
- Port 443 (HTTPS)
- Port 25 (SMTP, if mail enabled)
- Port 110 (POP3, if mail enabled)
- Port 143 (IMAP, if mail enabled)
- Port 389 (LDAP, if enabled)
Deny all other ports

Performance Optimization

1. Database Optimization

Monitor and optimize database performance:

In Citadel admin panel:
1. Go to System Administration → Database Maintenance
2. Run database optimization
3. Verify integrity
4. Review transaction logs

2. Connection Pooling

Configure connection limits:

In citadel.conf:
max_concurrent_clients = 200
max_idle_time = 1800

3. Caching

Enable caching for frequently accessed data:

  1. In admin panel, go to Performance Settings
  2. Enable message caching
  3. Set cache size based on available memory
  4. Configure cache expiration

4. Resource Monitoring

Monitor system resources:

Terminal window
# Monitor memory usage
free -h
# Monitor disk usage
df -h
# Check Citadel process
ps aux | grep citserver
# View logs
tail -f /var/log/citadel/citadel.log

5. Mail Queue Management

Monitor and manage mail queue:

In Citadel admin panel:
1. Go to System Administration → Mail Queue
2. View pending messages
3. Retry failed deliveries
4. Delete stuck messages if necessary

Monitoring and Logging

1. Access Application Logs

View Citadel logs through Klutch.sh:

  1. Go to your app in Klutch.sh
  2. Click Logs
  3. Filter by time range and log level

2. Monitor System Health

Check system status:

In Citadel admin panel:
1. Go to System Administration → System Overview
2. Review user counts and resource usage
3. Check for errors or warnings

3. Set Up Health Checks

Configure health monitoring:

#!/bin/bash
# Health check script
# Check if Citadel is responding
curl -f http://localhost/ > /dev/null 2>&1 || exit 1
# Check if services are running
ps aux | grep citserver > /dev/null || exit 1
# Check disk space
DISK_USAGE=$(df /var/lib/citadel | awk 'NR==2 {print $5}' | cut -d'%' -f1)
if [ $DISK_USAGE -gt 90 ]; then
exit 1
fi
exit 0

4. Enable Audit Logging

Configure detailed logging:

In System Administration:
1. Go to Logging Configuration
2. Enable audit logging
3. Log all admin actions
4. Log authentication attempts
5. Set log retention policy

5. Monitoring Tools

Integrate with monitoring services:

  • Prometheus: System metrics collection
  • Grafana: Visualization dashboards
  • ELK Stack: Log aggregation and analysis
  • New Relic: Performance monitoring
  • DataDog: Infrastructure monitoring

Custom Domains

To use a custom domain with your Citadel instance:

1. Add Domain in Klutch.sh

In the Klutch.sh dashboard, go to your app settings and add your custom domain (e.g., mail.example.com).

2. Update DNS Configuration

Update your DNS provider:

Web Interface:
CNAME: mail.example.com → example-app.klutch.sh
Email Service (if enabled):
MX: 10 mail.example.com
A: your.server.ip

3. Configure Domain in Citadel

In Citadel admin panel:

  1. Go to System AdministrationDomain Configuration
  2. Add your custom domain
  3. Set it as default mail domain (if using email)
  4. Configure SPF/DKIM/DMARC records

4. Update Certificates

If using custom domain for mail:

  1. Generate or import SSL certificate
  2. Update Citadel configuration with certificate paths
  3. Restart mail services

5. Verify DNS Propagation

Check DNS resolution:

Terminal window
nslookup mail.example.com
# or
dig mail.example.com CNAME

Once propagated, your Citadel instance will be accessible at your custom domain.


Troubleshooting

Issue 1: Citadel Container Won’t Start

Error: Container exits immediately or doesn’t respond to health checks

Solutions:

  • Check Docker logs: docker logs container_id
  • Verify Dockerfile builds locally: docker build -t citadel:test .
  • Ensure persistent volume is mounted: Check Klutch.sh volumes configuration
  • Check entrypoint script permissions: chmod +x entrypoint.sh
  • Review Citadel logs: Check /var/log/citadel/citadel.log

Issue 2: Cannot Access Web Interface

Error: 503 Service Unavailable or connection refused

Solutions:

  • Verify Citadel is running: Check process status
  • Verify port 80 is exposed and traffic is HTTP
  • Check firewall rules: Ensure port 80 is not blocked
  • Verify DNS resolution: dig example-app.klutch.sh
  • Check for port conflicts: Another service using port 80
  • Wait for full initialization: Container may need time on first start

Issue 3: Email Services Not Working

Error: SMTP/IMAP/POP3 connections fail or timeout

Solutions:

  • Verify Citadel is compiled with email support: Check build logs
  • Check if email ports are exposed: Verify firewall rules
  • Ensure mail protocols are enabled in Citadel: Go to System AdministrationService Configuration
  • Check mail domain configuration: Verify domain is registered in Citadel
  • Review mail logs: grep "mail\|SMTP\|IMAP" /var/log/citadel/citadel.log
  • Test connectivity: telnet example-app.klutch.sh 25 (for SMTP)

Issue 4: Disk Space Issues

Error: “Disk full” or message delivery failures

Solutions:

  • Check disk usage: df -h /var/lib/citadel
  • Monitor message storage: See mail queue size in admin panel
  • Archive old messages: Use admin tools to archive older data
  • Increase persistent volume size in Klutch.sh
  • Implement message retention policies
  • Clean up backup files if using local backups

Issue 5: Performance Issues (Slow Response)

Error: Web interface sluggish or mail delivery delays

Solutions:

  • Monitor CPU usage: top or Klutch.sh monitoring
  • Monitor memory usage: free -h
  • Check database size and optimize: Run database maintenance
  • Enable caching in admin panel
  • Increase compute resources in Klutch.sh
  • Review active user connections
  • Archive old messages to reduce database size
  • Check network latency: ping example-app.klutch.sh

Issue 6: User Authentication Fails

Error: Cannot log in or “Invalid credentials”

Solutions:

  • Verify user account exists: Check in System AdministrationUser Management
  • Reset password: Use admin panel to reset user password
  • Check account status: Verify account is not disabled
  • Review authentication logs: Check for failed attempts
  • Verify LDAP configuration if using LDAP authentication
  • Check if account is locked: Too many failed attempts may trigger lockout

Issue 7: Calendar/Address Book Not Syncing

Error: Calendar events or contacts not appearing on mobile clients

Solutions:

  • Verify CalDAV/CardDAV is enabled: Check System AdministrationService Configuration
  • Check client configuration: Verify credentials and server URL
  • Verify HTTPS is working: Mobile clients may require HTTPS
  • Check user permissions: Ensure user has access to calendar/address books
  • Review client compatibility: Some clients have specific requirements
  • Clear client cache: Force sync on mobile device

Issue 8: High Memory Usage

Error: Citadel process consuming excessive memory

Solutions:

  • Check for memory leaks: Monitor over time
  • Restart Citadel service: May release unused memory
  • Reduce cache size: Decrease in performance settings
  • Limit concurrent connections: Set max_concurrent_clients lower
  • Increase container memory limit in Klutch.sh
  • Archive or delete old messages
  • Check for stuck processes: Kill and restart if necessary

Best Practices

1. Regular Maintenance Schedule

Implement maintenance windows:

  • Weekly: Database optimization, log rotation
  • Monthly: Security updates check, user audits
  • Quarterly: Full system audit, capacity planning
  • Annually: Major version updates, comprehensive backup tests

2. User Administration

Implement proper user management:

  • Create users with appropriate access levels
  • Disable unused accounts
  • Regular password audits
  • Monitor user activity
  • Archive inactive user data
  • Document user policies

3. Backup and Disaster Recovery

Implement comprehensive backup strategy:

  • Daily backups: Full data and configuration
  • Weekly backups: Full system backup
  • Monthly backups: Long-term retention
  • Test restores: Regularly verify backups work
  • Off-site storage: Store backups remotely
  • Disaster recovery plan: Document recovery procedures

4. Capacity Planning

Plan for growth:

  • Monitor disk usage trends
  • Track user growth
  • Plan for seasonal peaks
  • Document resource usage
  • Set up alerts for thresholds

5. Documentation

Maintain comprehensive documentation:

  • System configuration and customizations
  • User policies and procedures
  • Backup and recovery procedures
  • Troubleshooting guides
  • Admin account and access control
  • Disaster recovery plan

6. Communication Setup

Optimize email delivery:

  • Configure SPF, DKIM, DMARC properly
  • Monitor deliverability metrics
  • Test email workflows
  • Configure bounce handling
  • Set up mailing list best practices

7. Room Organization

Organize workspace effectively:

  • Create room hierarchy matching organization
  • Define clear access policies
  • Document room purposes
  • Maintain consistent naming conventions
  • Regular review of unused rooms

8. Integration Planning

Plan for integrations:

  • Document external systems that connect
  • Maintain API keys securely
  • Test integration changes
  • Monitor integration health
  • Plan for API deprecations

9. Security Audit

Perform regular security reviews:

  • Review user permissions
  • Audit admin access logs
  • Check for orphaned accounts
  • Verify encryption settings
  • Test backup security
  • Review firewall rules

10. Performance Tuning

Continuously optimize performance:

  • Monitor resource usage patterns
  • Optimize database queries
  • Tune cache settings
  • Review mail queue performance
  • Monitor network utilization
  • Adjust resource allocation as needed

Verifying Your Deployment

After deployment completes:

  1. Check the App URL: Visit https://example-app.klutch.sh
  2. Log In: Use admin credentials (or default if first setup)
  3. Check Web Interface: Verify all menu options are accessible
  4. Review System Status: Go to System AdministrationSystem Overview
  5. Test User Creation: Create a test user account
  6. Check Storage: Verify persistent volume is mounted and has space
  7. Review Logs: Check Klutch.sh logs for any errors
  8. Test Email Services: If configured, test sending/receiving email
  9. Check Security: Verify HTTPS is working and certificate is valid
  10. Monitor Performance: Set up monitoring and establish baseline metrics

If your Citadel instance doesn’t work as expected, review the troubleshooting section and check the Klutch.sh dashboard logs for detailed error messages.


External Resources


Deploying Citadel to Klutch.sh using Docker provides a powerful, self-hosted email and collaboration platform with complete control over your communication infrastructure. By following this guide, you’ve learned how to create a production-ready Dockerfile, configure persistent storage for critical data, set up email services with proper security, manage users and rooms, implement security best practices, configure custom domains, monitor system health, and troubleshoot common issues. Your Citadel server is now running on Klutch.sh’s global infrastructure with professional-grade hosting, automatic HTTPS, and scalable infrastructure. For additional help or questions, consult the official Citadel documentation or contact Klutch.sh support.