I've wanted a centralized way to manage users and permissions across my network. While Windows Server is the industry standard, I prefer staying in the Open Source ecosystem. Samba AD-DC fits that need while also being significantly lighter on system resources.
What is Samba AD-DC?
Samba is not just for simple file sharing. When configured as an Active Directory Domain Controller (AD-DC), it replicates the behavior of a Windows Server—specifically matching functional levels between 2008 R2 and 2012 R2. It provides DNS, Kerberos authentication, and LDAP services.
In fact, this setup is robust enough that ANSSI (the French National Cybersecurity Agency) has provided security recommendations for it, proving it's a serious alternative for managing identities securely.
Deployement
> I decided to run this inside a Virtual Machine (VM) rather than a container. Samba has some historical friction with ZFS, and since my Proxmox containers use ZFS, a VM with a standard ext4 filesystem is much more stable for this use case.
Installing Dependencies
The official Debian repositories often carry older versions of Samba. To get the latest features, I download the source directly.
First, I set the frontend to non-interactive to avoid annoying pop-up prompts, then I grab the massive list of dependencies required for a full AD-DC build:
Compiling & Installing Samba
I download the latest source code and extract it. I then configure the build to follow the Filesystem Hierarchy Standard (FHS) and include systemd support.
To prevent a future apt update from accidentally overwriting my custom build, I "hold" the package:
Provisioning the Domain
This is where I initialize the domain. I'm using 8.8.8.8 as a forwarder here, though I usually point it to my AdGuard Home instance later.
When everything's done, you can set the Administrator password :
Managing Users
Adding users and assigning them to the "Domain Admins" group is straightforward with samba-tool:
Firewall Configuration
I use ufw to lock everything down except the essential Active Directory ports: