Rudder is an open-source and user-friendly web-based system configuration and audit tool. It helps you to manage your IT infrastructure by automating system configurations while ensuring visibility and control of your infrastructure. Two main components of Rudder are: Root server and node. Root server defines the configurations for the systems it manages. The systems managed by Rudder are known as nodes. Rudder manages the nodes using the Rudder agent which is installed on these systems.
In today’s post, we will install the Rudder root server and agent on Ubuntu 20.04 LTS. We will use two Ubuntu machines: one as the Rudder root server and the other one as the Rudder node.
Note: You must be a root user or have sudo privileges on both machines in order to install the Rudder server and agent.
Installing Rudder Root Server on Ubuntu
Follow the steps below on the machine you want to setup as a Rudder root server:
Step 1: Check Dependency
Rudder requires Java Runtime environment. To check if your system has Java RE installed, use the command below:
$ java -version
If it is installed, you will receive the below similar output.
Otherwise, use the command below for installing it:
$ sudo apt install default-jre
Step 2: Download and Import GPG Key
Now download and import the GPG key for the Rudder repository using the command below:
$ wget -q -O- "https://repository.rudder.io/apt/rudder_apt_key.pub" | sudo apt-key add –
You should see OK in the output.
Step 3: Add Rudder Repository
Add Rudder repository to the list of software sources in your system. Use the command below to add it in a separate file named rudder.list in the /etc/apt/sources.list.d directory.
$ echo "deb http://repository.rudder.io/apt/6.2/ focal main" | sudo tee -a /etc/apt/sources.list.d/rudder.list
After adding the Rudder repository, update the local package database using the command below:
$ sudo apt update
Step 4: Install Rudder
Now use the command below to install the Rudder root server on your system:
$ sudo apt install rudder-server-root
During installation, it will prompt you with the y/n option for proceeding with the installation procedure. Press y and then Enter to proceed.
During installation, it will ask if you want to configure the database for rsyslog-pgsql. Select Yes and hit Enter.
Then for the hostname of the PostgreSQL server, select localhost and then Ok. After that hit Enter.
Then you will be asked to set PostgreSQL application password for rsyslog-pgsql. Type a password, select OK, and hit Enter. If you don’t set any password, a random password will be generated.
Then again enter the password for confirmation. After that, the Rudder root server will be installed on your system.
Step 5: Create a User Account
Now create a user account for logging into the Rudder server.
$ sudo rudder server create-user -u <user_name>
Replace <user_name> with any user name you want to create.
Type a password for this user account and then confirm this password by typing it again.
Step 6: Configure Firewall
On the Rudder server, you will need to open 5309/TCP and 443/TCP ports in the firewall using the commands below:
$ sudo ufw allow 5309/tcp $ sudo ufw allow 443/tcp $ sudo ufw reload
Step 7: Access Rudder Web Interface
Now in order to access Rudder, open your web browser, and head over to the below address:
https://<rudder-server-IP>/rudder
Where <rudder-server-IP> is the IP address of your Rudder root server.
Log in using the user account credentials created in the previous step.
After login, you will see the following default dashboard of Rudder.
Remember, if you want to add nodes to Rudder server from another network, you must first add that network in the General > Allowed Networks in the Rudder web interface.
Installing Rudder Agent on Ubuntu
Follow the steps below on the machines you want to setup as Rudder nodes:
Step 1: Download and Import GPG Key
Use the command below to download and import the GPG key for Rudder repository:
$ wget -q -O- "https://repository.rudder.io/apt/rudder_apt_key.pub" | sudo apt-key add –
You should see OK in the output.
Step 2: Add Rudder Repository
Add Rudder repository to your system’s list of software sources. Use the command below to add Rudder repository to a separate file named rudder.list in the /etc/apt/sources.list.d directory.
$ echo "deb http://repository.rudder.io/apt/6.2/ focal main" | sudo tee -a /etc/apt/sources.list.d/rudder.list
After adding the Rudder repository, update the local package database using the command below:
$ sudo apt update
Step 3: Install Rudder Agent
Now you can install the Rudder agent on your system using the command below:
$ sudo apt install rudder-agent
During installation, it will prompt you with the y/n option for proceeding with the installation procedure. Press y and then Enter to proceed.
After that, Rudder agent will be installed on your system.
Then start the Rudder agent using the command below:
$ sudo rudder agent start
Step 4: Configure Rudder Agent
After agent installation, the node will be required to register itself on the Rudder server. Use the command below to do so:
$ sudo rudder agent policy-server <Rudder-server-IP>
Where <Rudder-server-IP> is the IP address of the server where the Rudder root server is installed.
Validate New Node on Rudder Server
Now you will need to accept the added nodes on the Rudder server for it to become a managed node. From the Rudder server web interface, go to Node management > Pending nodes.
Here, you will see the new node listed under the Pending nodes. To add this node to the Rudder server, select the checkbox in front of the node and click Accept.
Then in the following window, click Accept to confirm adding the nodes in the Rudder server.
Now go to Node management > Nodes.
Then you will find your node listed under the Nodes section.
If you do not find your node under the Pending nodes list, run the below command on the node:
$ sudo rudder agent inventory
This command will force the rudder agent on the Node to run and send an inventory to the Rudder server.
You can also run the command below to forcefully run the Rudder agent:
$ sudo rudder agent run
Rudder Services Management
If you need to restart the Rudder server or agent services, here are the commands:
Restart Everything on Rudder Server
To restart each component of the Rudder Server, use this command:
$ sudo systemctl restart rudder-server
Restart Rudder Agent on Node
To restart the Rudder Agent, use this command on the node:
$ sudo rudder agent restart
In this tutorial, I described how to install the Rudder root server and agent on Ubuntu 20.04 LTS. We also described how to add a Rudder node in the Rudder root server. Similarly, you can add more nodes to the Rudder root server. For more information, visit Rudder’s official documentation.