A comprehensive web-based interface for managing Samba Active Directory Domain Controllers through the Cockpit web console. This module provides enterprise-grade domain controller management with automatic failover capabilities, FSMO role management, and modern web-based administration.
Cockpit Domain Controller provides superior infrastructure automation that complements Microsoft RSAT tools for a complete enterprise AD solution:
- π― Perfect Division of Labor: Cockpit handles infrastructure automation, RSAT manages AD objects
- π Intelligent Automation: Features Microsoft AD lacks (automatic DHCP/NTP failover)
- π° Cost Effective: No Windows Server licensing, no CALs required
- π οΈ Familiar Management: Existing Windows admins use standard RSAT tools
- π Enterprise Grade: Production-ready with advanced failover capabilities
- Domain Provisioning: Create new Active Directory domains with full configuration
- Domain Joining: Join existing domains as additional domain controllers
- Domain Statistics: Real-time monitoring of users, computers, groups, and OUs
- Service Management: Control Samba AD-DC, NTP, and DHCP services
- FSMO Role Monitoring: Track and display all five FSMO roles with live updates
- DHCP Failover: Automatic DHCP service failover based on PDC Emulator role
- NTP Hierarchy: Automatic time synchronization hierarchy with PDC as authoritative source
- Configuration Replication: Service configurations stored in SYSVOL for automatic replication
- Service Monitoring: Real-time status monitoring with automated failover detection
- Network Interface Selection: Choose appropriate network interfaces for domain services
- Firewall Integration: Automatic firewall configuration for AD services
- NTP Configuration: Intelligent NTP hierarchy based on domain controller roles
- Security Hardening: Proper service isolation and security configurations
- Comprehensive Logging: Detailed logging for troubleshooting and auditing
- Cockpit Framework: Modern web-based server management interface
- PatternFly v5: Enterprise-grade UI components and design system
- JavaScript ES6: Modern JavaScript with module support
- HTML5/CSS3: Responsive design with light/dark theme support
- Samba AD-DC: Core Active Directory Domain Controller functionality
- Bash Scripting: Service management and automation scripts
- systemd: Service management and timer-based monitoring
- Chrony: Network Time Protocol (NTP) implementation
- ISC DHCP Server: Dynamic Host Configuration Protocol services
- SYSVOL Replication: Configuration storage and replication
- Cockpit API: System interaction and command execution
- systemd Journal: Centralized logging and monitoring
- Firewalld: Network security and port management
- Debian 12 (Bookworm) or later
- Ubuntu 22.04 LTS or later
- Other systemd-based Linux distributions (with adaptation)
- Cockpit (>= 266)
- Samba AD-DC with all required modules
- Chrony (NTP client/server)
- ISC DHCP Server
- Firewalld (for network security)
- Python 3 with Samba bindings
- Minimum: 2 CPU cores, 4GB RAM, 20GB disk space
- Recommended: 4+ CPU cores, 8GB+ RAM, 50GB+ disk space
- Network: Static IP address configuration recommended
# Download and install the package
sudo dpkg -i cockpit-domain-controller_1.0.42-1.deb
# Install dependencies if needed
sudo apt-get install -f# Clone the repository
git clone https://github.com/your-org/cockpit-domain-controller.git
cd cockpit-domain-controller
# Install files
sudo cp -r * /usr/share/cockpit/domain-controller/
sudo systemctl restart cockpit- Access Cockpit: Navigate to
https://your-server:9090 - Domain Controller: Click on "Domain Controller" in the sidebar
- Network Configuration: Ensure proper network interface configuration
- Firewall Rules: Verify firewall rules are properly configured
Cockpit Domain Controller excels at infrastructure automation that Microsoft AD struggles with, while Microsoft RSAT tools provide familiar AD object management. This combination creates a superior enterprise solution:
β
Domain provisioning and joining - Streamlined domain controller deployment
β
FSMO role monitoring - Real-time status of all 5 roles with live updates
β
Intelligent service failover - Automatic DHCP/NTP failover based on PDC role
β
Service automation - Auto-start samba-ad-dc after domain operations
β
Network configuration - Interface selection, DNS setup, firewall rules
β
Modern monitoring - Web-based real-time infrastructure monitoring
β
User management - Create, modify, disable users (Active Directory Users & Computers)
β
Group management - Security/distribution groups, membership (ADUC)
β
Computer accounts - Join computers, manage properties (ADUC)
β
OU management - Create hierarchy, move objects (ADUC)
β
DNS management - A records, PTR records, zones (DNS Manager)
β
Sites and services - Site links, subnets, replication (AD Sites & Services)
# Windows 10/11 - Install RSAT via Windows Features
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online
# Or install specific tools:
Add-WindowsCapability -Name "Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0" -Online
Add-WindowsCapability -Name "Rsat.Dns.Tools~~~~0.0.1.0" -Online
Add-WindowsCapability -Name "Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0" -Online- Active Directory Users & Computers: Right-click β "Change Domain Controller" β Select your Samba DC
- DNS Manager: Connect to your Samba DC's DNS service
- All RSAT tools: Automatically discover and connect to Samba domain controllers
For full RSAT compatibility, consider:
- Option A: Use Windows DHCP Server on separate machine (full RSAT DHCP management)
- Option B: Continue with ISC DHCP + Cockpit web management (current setup)
Recommended: Deploy separate Windows DHCP server for complete RSAT integration while keeping Cockpit's intelligent automation for other services.
Microsoft Active Directory lacks:
- Automatic DHCP failover based on FSMO roles
- Intelligent NTP hierarchy management
- Modern web-based infrastructure monitoring
- Automated service startup after domain operations
- Real-time FSMO role status monitoring
- Cross-platform compatibility and cost savings
Result: Enterprise-grade Active Directory with superior automation + familiar management tools
-
Navigate to the Domain Controller section
-
Click on "Provision New Domain"
-
Configure domain settings:
- Domain Name: Your domain FQDN (e.g.,
company.local) - NetBIOS Name: Short domain name (e.g.,
COMPANY) - Administrator Password: Strong domain admin password
- Network Interface: Select appropriate network interface
- DNS Configuration: Configure DNS forwarders
- NTP Servers: Set time synchronization sources
- Domain Name: Your domain FQDN (e.g.,
-
Click "Provision Domain" to create the domain
-
Navigate to "Join Existing Domain"
-
Enter domain connection details:
- Domain to Join: Target domain FQDN
- Domain Controller IP: IP of existing DC
- Domain Administrator: Admin username
- Password: Admin password
- Network Interface: Select interface
- Site Name: AD site name (optional)
-
Click "Join Domain" to join as additional DC
The system implements automatic DHCP failover based on the PDC Emulator FSMO role:
- Access DHCP Management: Click "Configure" next to DHCP Server
- Monitor Status: View current PDC Emulator and failover status
- Configuration Sync: Sync DHCP configuration to SYSVOL
- Force Failover: Manually trigger failover for testing
- View Logs: Monitor recent failover activity
How DHCP Failover Works:
- Only the PDC Emulator server runs DHCP service
- DHCP configuration is stored in SYSVOL for replication
- When PDC role transfers, DHCP automatically fails over
- Monitoring occurs every 5 minutes via systemd timer
Automatic time synchronization hierarchy based on domain controller roles:
- Access NTP Management: Click "Configure" next to NTP service
- Monitor Hierarchy: View current time source role and status
- Check Synchronization: Monitor stratum level and time offset
- Force Reconfiguration: Manually update NTP configuration
- View Status: Real-time chrony tracking information
How NTP Hierarchy Works:
- PDC Emulator synchronizes with external NTP servers (Stratum 10)
- Other domain controllers sync with PDC Emulator (Stratum 11)
- Domain clients sync with any domain controller
- Configuration automatically updates when PDC role changes
The interface displays all five FSMO roles with real-time status:
- PDC Emulator: Time synchronization, password changes, legacy DC functions
- RID Master: Allocates RID pools to domain controllers
- Infrastructure Master: Maintains cross-domain references
- Schema Master: Controls AD schema modifications (forest-wide)
- Domain Naming Master: Controls domain addition/removal (forest-wide)
- Crown Icon: Indicates which server holds each role
- This Server: Highlighted roles held by current server
- Real-time Updates: Automatic refresh every 5 minutes
- Manual Refresh: Force update of role information
The system automatically configures firewall rules for:
- DNS: Ports 53/tcp, 53/udp
- Kerberos: Ports 88/tcp, 88/udp, 464/tcp, 464/udp
- LDAP: Ports 389/tcp, 389/udp, 636/tcp
- SMB: Port 445/tcp
- RPC: Port 135/tcp
- Global Catalog: Ports 3268/tcp, 3269/tcp
- DHCP: Ports 67/udp, 68/udp
- NTP: Port 123/udp
- Cockpit: Port 9090/tcp
- Service Isolation: Each service runs with minimal privileges
- Security Hardening: systemd security features enabled
- Audit Logging: Comprehensive logging for security monitoring
- Access Control: Proper file permissions and ownership
The system implements Microsoft Active Directory best practices for service management:
- PDC Emulator: Runs DHCP and acts as authoritative time source
- Other DCs: Sync with PDC for time, DHCP services stopped
- Automatic Detection: Continuous monitoring of FSMO role changes
- SYSVOL Storage: Service configurations stored in replicated SYSVOL
- Automatic Sync: Configuration changes replicated to all DCs
- Backup Management: Versioned configuration backups maintained
1. Timer monitors PDC Emulator role (every 5 minutes)
2. If server becomes PDC:
- Retrieve service configs from SYSVOL
- Start appropriate services (DHCP, NTP as authoritative)
- Store current config to SYSVOL
3. If server loses PDC:
- Store current config to SYSVOL
- Reconfigure services (NTP sync with new PDC)
- Stop PDC-specific services (DHCP)
4. Continue monitoring
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β PDC Emulator β β Other DC #1 β β Other DC #2 β
β β β β β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β DHCP Server β β β β DHCP Server β β β β DHCP Server β β
β β (ACTIVE) β β β β (STOPPED) β β β β (STOPPED) β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β β β β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
β β SYSVOL βββΌβββββΌβΊβ SYSVOL βββΌβββββΌβΊβ SYSVOL β β
β β (Config) β β β β (Config) β β β β (Config) β β
β βββββββββββββββ β β βββββββββββββββ β β βββββββββββββββ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ
β External NTP β
β Servers β
β (Stratum 1-9) β
βββββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β PDC Emulator β β Other DC #1 β β Other DC #2 β
β (Stratum 10) ββββββ€ (Stratum 11) β β (Stratum 11) β
β β β β β β
β Authoritative β β Syncs with PDC β β Syncs with PDC β
β Time Source β β + External NTP β β + External NTP β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Domain Clients β
β (Sync with any DC) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
cockpit-domain-controller/
βββ manifest.json # Cockpit module manifest
βββ domain-controller.html # Main HTML interface
βββ domain-controller.js # Frontend JavaScript logic
βββ domain-controller.css # Styling and theme support
βββ dhcp-fsmo-manager.sh # DHCP failover management script
βββ dhcp-fsmo-monitor.service # DHCP monitoring systemd service
βββ dhcp-fsmo-monitor.timer # DHCP monitoring timer
βββ ntp-fsmo-manager.sh # NTP hierarchy management script
βββ ntp-fsmo-monitor.service # NTP monitoring systemd service
βββ ntp-fsmo-monitor.timer # NTP monitoring timer
βββ README.md # This documentation
- DomainController Class: Main application logic
- Service Management: Real-time service status monitoring
- FSMO Monitoring: Live FSMO role tracking
- Configuration UI: Domain provisioning and joining interfaces
- Theme Support: Light/dark mode compatibility
- dhcp-fsmo-manager.sh: DHCP failover automation
- ntp-fsmo-manager.sh: NTP hierarchy management
- systemd Integration: Service and timer configurations
- SYSVOL Integration: Configuration replication
- PatternFly v5: Enterprise UI components
- Responsive Design: Mobile and desktop support
- Theme Compatibility: Cockpit light/dark theme support
- Accessibility: WCAG compliance considerations
# Build package structure
mkdir -p cockpit-domain-controller_1.0.42-1/usr/share/cockpit/domain-controller
mkdir -p cockpit-domain-controller_1.0.42-1/DEBIAN
# Copy files
cp -r src/* cockpit-domain-controller_1.0.42-1/usr/share/cockpit/domain-controller/
cp debian/control cockpit-domain-controller_1.0.42-1/DEBIAN/
cp debian/postinst cockpit-domain-controller_1.0.42-1/DEBIAN/
# Build package
dpkg-deb --build cockpit-domain-controller_1.0.42-1- Manifest Version: Update
manifest.jsonversion field - Package Version: Update
DEBIAN/controlversion field - Changelog: Document changes and improvements
- Privilege Separation: Services run with minimal required privileges
- systemd Security: Hardened service configurations
- Firewall Integration: Automatic security rule management
- Audit Logging: Comprehensive security event logging
- Access Control: Proper file permissions and ownership
- Network Security: Ensure proper network segmentation
- Password Policy: Use strong passwords for domain accounts
- Certificate Management: Implement proper PKI for LDAPS
- Backup Security: Secure backup of domain database
- Monitoring: Regular security monitoring and alerting
- Network: Use VLANs for domain controller isolation
- Firewall: Implement network-level firewalls
- Updates: Keep all software components updated
- Monitoring: Implement security monitoring solutions
- Backup: Regular, secure backups of domain data
- Service Status: Real-time service health monitoring
- FSMO Roles: Continuous FSMO role status tracking
- Time Synchronization: NTP offset and stratum monitoring
- DHCP Failover: Failover event tracking and logging
- Cockpit Logs:
journalctl -u cockpit - Samba AD-DC:
journalctl -u samba-ad-dc - DHCP Failover:
journalctl -u dhcp-fsmo-monitor - NTP Management:
journalctl -u ntp-fsmo-monitor - Chrony:
journalctl -u chrony
- systemd Journal: Centralized logging with log levels
- Email Notifications: Configure with external tools
- SNMP Integration: Available through system monitoring tools
- Custom Alerts: Implement using systemd and scripting
# Check Samba service status
systemctl status samba-ad-dc
# Verify network configuration
ip addr show
resolvectl status
# Check DNS resolution
nslookup your-domain.local
# Review logs
journalctl -u samba-ad-dc -f# Check DHCP FSMO monitor
systemctl status dhcp-fsmo-monitor.timer
journalctl -u dhcp-fsmo-monitor -f
# Verify PDC Emulator role
samba-tool fsmo show
# Check SYSVOL replication
ls -la /var/lib/samba/sysvol/*/dhcp-configs/
# Manual failover test
/usr/local/bin/dhcp-fsmo-manager.sh# Check NTP hierarchy
chronyc tracking
chronyc sources
# Verify NTP FSMO monitor
systemctl status ntp-fsmo-monitor.timer
journalctl -u ntp-fsmo-monitor -f
# Manual NTP configuration
/usr/local/bin/ntp-fsmo-manager.sh
# Check time offset
chronyc sourcestats# Restart Cockpit
systemctl restart cockpit
# Check Cockpit logs
journalctl -u cockpit -f
# Verify module installation
ls -la /usr/share/cockpit/domain-controller/
# Check browser console for JavaScript errors# Domain status
samba-tool domain level show
samba-tool domain info
# FSMO roles
samba-tool fsmo show
# Service status
systemctl status samba-ad-dc chrony isc-dhcp-server
# Network connectivity
ss -tuln | grep -E "(53|88|389|445|636|3268|3269)"
# Time synchronization
chronyc tracking
chronyc sources -v
# DHCP status
systemctl status isc-dhcp-server
dhcp-lease-list- Clone Repository:
git clone https://github.com/your-org/cockpit-domain-controller.git - Install Dependencies: Set up development environment
- Testing: Test changes in development environment
- Documentation: Update documentation for changes
- JavaScript: Use ES6+ features, consistent indentation
- CSS: Follow PatternFly conventions
- Bash: Use shellcheck for script validation
- HTML: Semantic markup with accessibility considerations
- Fork Repository: Create your own fork
- Feature Branch: Create feature branch from main
- Testing: Thorough testing of changes
- Documentation: Update relevant documentation
- Pull Request: Submit with detailed description
This project is licensed under the GNU Lesser General Public License v2.1 or later. See the LICENSE file for details.
- README: This comprehensive guide
- Wiki: Additional documentation and examples
- Man Pages: System manual pages for scripts
- GitHub Issues: Bug reports and feature requests
- Discussions: Community support and questions
- Wiki: Community-contributed documentation
- Professional Services: Available for enterprise deployments
- Custom Development: Tailored solutions for specific requirements
- Training: Comprehensive training programs available
- Cockpit Project: Modern web-based server management
- PatternFly: Enterprise UI component library
- Samba Team: Active Directory implementation
- systemd: System and service management
- Chrony: Network time synchronization
- Domain Controller Team: Core development and maintenance
- Community Contributors: Bug reports, feature requests, and improvements
- Beta Testers: Early testing and feedback
Cockpit Domain Controller + Microsoft RSAT = Superior Microsoft AD Alternative
- π Superior FSMO automation - Microsoft AD requires manual DHCP/NTP configuration
- π Modern web interface - Better than Microsoft's legacy management tools
- π€ Intelligent service failover - Automatic DHCP/NTP failover based on roles
- π§ Cross-platform compatibility - Runs on Linux with enterprise hardening
- π° Zero licensing costs - No CALs or Windows Server licenses required
- β‘ Real-time monitoring - Live FSMO role status and service monitoring
β
File server authentication - Domain controller for enterprise file sharing
β
Linux environment management - Perfect for Linux-centric organizations
β
Cost-sensitive deployments - Eliminate Windows Server licensing costs
β
Hybrid environments - Windows clients with Linux infrastructure
β
Infrastructure automation focus - Organizations prioritizing automated failover
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β Cockpit Domain β β Microsoft RSAT Tools β
β Controller β β (Windows Workstation) β
β β β β
β β’ Infrastructure βββββΊβ β’ User Management β
β Automation β β β’ Group Management β
β β’ Service Failover β β β’ Computer Accounts β
β β’ FSMO Monitoring β β β’ DNS Management β
β β’ Network Config β β β’ OU Management β
β β’ Modern Web UI β β β’ Familiar Windows UI β
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
- RSAT tools are free - No Windows Server CALs required
- Legal to use with Samba - RSAT designed for AD-compatible services
- No license violations - Managing Samba domain controllers, not Windows
This is a solid, enterprise-grade Microsoft Active Directory replacement that combines the best of both worlds - superior infrastructure automation with familiar administrative tools. It's production-ready for organizations needing robust domain services without Microsoft licensing costs.
Cockpit Domain Controller - Enterprise-grade Samba Active Directory management through modern web interface with automatic failover capabilities and RSAT compatibility.
For more information, visit: https://github.com/dguedry/cockpit-domain-controller