Atlantic.Net Blog

How to Install Rundeck on CentOS 8

Rundeck is a free and open-source tool used for managing multiple servers from a single server. Written in Java programming language, Rundeck provides a web-based interface to perform all administrative tasks. It uses a MySQL/MariaDB database to store the job definitions and execution history. Rundeck comes with a lot of tools that make it easier for you to scale up your automation efforts.

In this tutorial, we will show you how to install Rundeck on CentOS 8.

Step 1 – Install Java

Rundeck is written in Java, so Java must be installed in your system. If not installed, you can install it with the following command:

dnf install java -y

After installing Java, you can verify the installed version of Java using the following command:

java -version

You should see the following output:

openjdk version "1.8.0_262"
OpenJDK Runtime Environment (build 1.8.0_262-b10)
OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)

Step 2 – Install and Configure MySQL

Rundeck uses a MySQL database to store the job and other history, so you will need to install MySQL on your server. You can install it with the following command:

dnf install mysql-server -y

Once installed, start the MySQL service and enable it to start at system reboot with the following command:

systemctl start mysqld
systemctl enable mysqld

Next, you will need to create a database and user for Rundeck. First, log into the MySQL shell with the following command:

mysql

Once logged in, create a database and user with the following command:

create database rundeck;
create user 'rundeckuser'@'localhost' identified by 'rundeckpassword';

Next, grant all the privileges to the Rundeck database with the following command:

grant ALL on rundeck.* to 'rundeckuser'@'localhost';

Next, flush the privileges and exit from MySQL with the following command:

flush privileges;
exit;

Step 3 – Install Rundeck

By default, Rundeck is not available in the CentOS 8 default repository, so you will need to add Rundeck repository to your system.

First, import the Rundeck GPG key with the following command:

rpm --import http://rundeck.org/keys/BUILD-GPG-KEY-Rundeck.org.key

Next, add the Rundeck repository with the following command:

dnf install -y http://repo.rundeck.org/latest.rpm

Next, install Rundeck by running the following command:

dnf install rundeck -y

Once Rundeck is installed, you can proceed to the next step.

Step 4 – Configure Rundeck

Next, you will need to define your server address and database details in the Rundeck configuration file. Edit the Rundeck default configuration file as shown below:

nano /etc/rundeck/rundeck-config.properties

Change the following lines:

grails.serverURL=http://your-server-ip:4440
dataSource.dbCreate = update
dataSource.url = jdbc:mysql://localhost/rundeck?autoReconnect=true&useSSL=false&serverTimezone=UTC
dataSource.username=rundeckuser
dataSource.password=rundeckpassword
dataSource.driverClassName=com.mysql.jdbc.Driver

Save and close the file when you are finished, then start the Rundeck server and enable it to start at system reboot with the following command:

systemctl enable rundeckd
systemctl start rundeckd

You can now verify the status of the Rundeck service with the following command:

systemctl status rundeckd

You should get the following output:

Step 5 – Access Rundeck Web Interface

At this point, Rundeck is started and listening on port 4440. Now, open your web browser and type the URL http://your-server-ip:4440. You will be redirected to the Rundeck login page:

Provide the default username as admin and password as admin and click on the Log In button. You should see the Rundeck dashboard in the following page:

Next, click on the New Project button to create a new project. You should see the following page:

Provide your project name, label, and description and click on the Create button. You should see the following page:

Click on the Commands in the left pane. You should see the following page:

Type the command “free -m” and click on the “Run on 1 Node“. This will execute the command on the localhost and display the output of the command as shown in the following page:

Conclusion

In this guide, we learned how to install Rundeck and integrate it with the MySQL database on CentOS 8. We have also created a new project and execute commands with Rundeck. For more information about Rundeck, visit the Rundeck documentation. If you’re ready to try Rundeck, get started on dedicated server hosting from Atlantic.Net.

Get a $250 Credit and Access to Our Free Tier!

Free Tier includes:
G3.2GB Cloud VPS a Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year