Future releases will ship with the dedicated server included, so building it from source will no longer be necessary, but for reference I'm leaving this information anyway. Instructions for building from source can be found here, and the only thing you need to do to build the dedicated server is to enable it in CMake, either using ccmake or by adding -DBUILD_DEDICATED_SERVER=YES to the make command. Note that the client is built by default, so unless you explicitly disable that you will get both the server and client.
To start the server just run the resulting server binary. Note that the dedicated server outputs to server.log instead of console.log as it would when run from the client. When run from an interactive shell, it accepts console commands from the command-line, which can be used to configure different options. I recommend reading the console page to understand how it works. The following are the important variables for a dedicated server:
map The default map. This is what will be loaded when the server starts.
maxplayers The maximum number of players allowed on the server.
servername The name displayed in the server browser.
serverport The port the server will run on. 12010 by default.
serverpwd The password required to connect to the server as admin. Regular users do not need to know this. Defaults to password, so you should really change this immediately.