This tutorial will explain all the steps you need to take care off in order to install and configure Samba4 as a Domain Controller on Ubuntu 16.04 and 14.04.