Rudder is an open-source web-based IT infrastructure configuration and automation platform that helps in configuring and managing systems across organizations. It allows you to automate complex configurations and control your IT infrastructure while maintaining security guidelines.

Rudder has two main components: root server and node. The root server defines configurations for the managed nodes, whereas nodes are the systems managed by the root server.

Here's how you can install and set up the Rudder root server and nodes on Debian/Ubuntu.

Installing the Rudder Root Server on Debian/Ubuntu

To install the Rudder root server on Debian/Ubuntu, you can use the official repository. The Rudder root server requires Java RE as a prerequisite. To install Java on Debian/Ubuntu, use the following command:

        sudo apt install default-jre
    

Then, add the Rudder repository key using the following command:

        sudo wget --quiet -O /etc/apt/trusted.gpg.d/rudder_apt_key.gpg https://repository.rudder.io/apt/rudder_apt_key.gpg
    

Next, add the Rudder repository to your system:

        echo "deb http://repository.rudder.io/apt/7.2/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rudder.list
    

Update the repository index with:

        sudo apt update
    

Now you can install the Rudder root server using the following command:

        sudo apt install rudder-server
    

Configuring the Rudder Root Server

After the Rudder root server is installed, you need to configure it. Create a user account that you will use to log in to the Rudder web UI. Open the terminal and run the following command to create the user account:

        sudo rudder server create-user -u <username>
    

Then, set the password for this user account.

For smooth operations, you will need to open TCP ports 5309 and 443 on your server's firewall. Use the following commands to do so:

        sudo ufw allow 443/tcp
sudo ufw allow 5309/tcp

Access the Rudder web interface by heading over to the Rudder root server IP address or hostname using a web browser:

        https://<ipaddress>/rudder
    

Log in to the web interface using the username and password you created above. Then, from the left sidebar in the Rudder web interface, go to Administration > Settings.

Under General settings, go to Allowed Networks. Here, configure the networks from which you want to allow the nodes to connect to the Rudder server. Add the networks in the network-ID/mask format.

For instance, to allow the node with an IP address 192.168.42.137/24 to connect to the Rudder server, you will add it as 192.168.42.0/24.

allowed networks in Rudder server

In case, you need to restart the root server, use the following command:

        sudo systemctl restart rudder-server
    

Installing the Rudder Agent on Debian/Ubuntu

To manage a node or host on Rudder, you need to install an agent. You can use the official repository to install the Rudder agent on nodes. Begin by adding the Rudder repository GPG key into your system using the following command:

        sudo wget --quiet -O /etc/apt/trusted.gpg.d/rudder_apt_key.gpg "https://repository.rudder.io/apt/rudder_apt_key.gpg"
    

Then, add the Rudder repository to your system using the following command:

        echo "deb http://repository.rudder.io/apt/7.2/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rudder.list
    

Update the repository index by typing:

        sudo apt update
    

Now, you can install the Rudder agent using the following command:

        sudo apt install rudder-agent
    

Configuring the Rudder Agent

After installing the Rudder agent, you will need to enable its contact with the Rudder root server. You can accomplish this in two ways: either by adding the Rudder root server IP address or hostname in the /var/rudder/cfengine-community/policy_server.dat file:

        echo sudo tee /var/rudder/cfengine-community/policy_server.dat
    

Or, by running the following command, replacing <ip-or-hostname> with the IP address or the hostname of the Rudder root server:

        sudo rudder agent policy-server <ip-or-hostname>
    

In case, you need to restart the Rudder agent, use the following command:

        sudo rudder agent restart
    

Adding a Node to the Rudder Server

After you have installed and configured the Rudder agent on the node, an inventory (containing hardware and software information) will be sent to the root server to register the node.

From the left sidebar in the Rudder web interface, go to Node management > Pending nodes. You will see your new node listed in the Pending nodes window. Select the node using the checkbox next to it and click Accept.

pending node in rudder

Then, click Accept in the next window to confirm it. Now your node will be added to the Rudder server.

Accept node in rudder

To view all the managed nodes on the Rudder server, go to Node management > Nodes.

rudder nodes

Click a node to view all the information associated with it. If you do not see the node listed under Pending nodes, you can manually run the agent and trigger an inventory using either of the following commands:

        sudo rudder agent inventory
    

Or

        sudo rudder agent run
rudder agent inventory

Uninstalling the Rudder Agent From a Node

To uninstall the Rudder agent on the node, use the following command:

        sudo apt remove rudder-agent
    

After uninstalling the Rudder agent, run the following command to verify none of the Rudder services are running:

        ps aux | grep rudder
    

Also, delete the Rudder directories:

        sudo rm -rf /opt/rudder
sudo rm -rf /var/rudder

After completely removing the Rudder agent from the node, you will also need to remove the node from the Rudder root server. Go to Node management > Nodes. From there, select the node you want to remove.

Under the Summary page, click the Delete button to remove this node from the root server. Now, the Rudder root server will no longer manage the node.

Delete node from Rudder server

Uninstalling the Rudder Root Server on Ubuntu/Debian

To uninstall the Rudder root server from Ubuntu, run the following command:

        sudo apt remove rudder-server
    

To verify none of the Rudder services are running, run the following command:

        ps aux | grep rudder
    

Also, delete the directories related to Rudder from the root server:

        sudo rm -rf /opt/rudder
sudo rm -rf /var/rudder

Automate and Manage Your Infrastructure From One Central Server

Rudder allows you to save time and increase efficiency by automating and managing your IT infrastructure. You should now be able to install and set up the Rudder infrastructure management platform on Ubuntu and Debian.

As an alternative to Rudder, you can use the free and open-source Ansible automation platform. It is available for multiple platforms including Linux, Windows, and Mac.