Rundeck is an open source software for automation service which helps to create simple to complex tasks on a local machine or in a remote machine.
Rundeck comes with command line tools, WebApi and command line tools. Rundeck is available in commercial and community edition. It is built around the concept of managing servers in a computer network using a single centralized management server. The administrative tasks can be performed by using a web interface.
Here at Ibmi Media, we will look into how to install Rundeck on Ubuntu 20.04.
1. Perform System Update
Before performing the installation, update and upgrade the Ubuntu system to its latest index repository:
$ sudo apt update
$ sudo apt upgrade
2. Install Java on the system
Rundeck is a Java based application and to run the application we need a java 8 or java 11. Install JDK 11 using the following command:
$ sudo apt install openjdk-11-jre
$ java –version
3. Install Database (Mysql/Mariadb)
Rundeck can be installed with database MySQL/MariaDB, MS SQL, PostgreSQL and Oracle to store the data. In this example, we are going to use MariaDB.
Install dependency and MariaDB packages using the command:
$ sudo apt install software-properties-common mariadb-server mariadb-client
Then, Enable and start mariadb service:
$ sudo systemctl enable mariadb.service
$ sudo systemctl status mariadb.service
Once the MySQL/MariaDB is installed, run the following command to secure the database system:
$ sudo mysql_secure_installation
Now create a database and database user for Rundeck:
$ mysql -u root -p
MariaDB [(none)]> CREATE DATABASE rundeck_db;
MariaDB [(none)]> CREATE USER 'rundeck_user'@'localhost' IDENTIFIED BY 'my-strong-password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'rundeck_user'@'localhost' WITH GRANT OPTION;
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> exit
Replace "my-strong-password" with your database password which will be used by the Rundeck application.
4. Install Rundeck on the system
The Rundeck application package is not available in Ubuntu 20.04 by default. We need to Create a repository file and append the following content in the file:
$ sudo nano /etc/apt/sources.list.d/rundeck.list
Then, Add the below lines to this file:
deb https://packages.rundeck.com/pagerduty/rundeck/any/ any main
deb-src https://packages.rundeck.com/pagerduty/rundeck/any/ any main
Save the file and exit.
Once the repository file is created, run the following command to import the repo signing key:
$ curl -L https://packages.rundeck.com/pagerduty/rundeck/gpgkey | sudo apt-key add -
Update the Ubuntu system to reflect the changes:
$ sudo apt update
Now install rundeck using the following command:
$ sudo apt install rundeck
Once the installation is completed, some configuration files need to be changed. Edit the file rundeck-config.properties using any text editor and make the following changes:
$ sudo nano /etc/rundeck/rundeck-config.properties
grails.serverURL=http://RUNDECK_SERVER_IP:4440
dataSource.driverClassName = org.mariadb.jdbc.Driver
dataSource.url = jdbc:mysql://localhost/rundeck_db?autoReconnect=true&useSSL=false
dataSource.username = rundeck_user
dataSource.password = my_strong_password
Replace the following things with your environment:
grails.serverURL => Replace with your Rundesk server domain or IP with port
dataSource.ur => Replace localhost with your database hostname, rundeck_db with your rundeck database name
dataSource.username => Database username
dataSource.password => Database password
Next, Enable and start the rundeck service as:
$ sudo systemctl enable rundeckd.service
$ sudo systemctl start rundeckd.service
If ufw is running on the ubuntu system, we need to allow the rundeck port for incoming traffic. Run the following command to open the rundeck port:
$ sudo ufw allow 4440/tcp
From your web browser, you can run:
http://rundeck_server_ip:4440
Use the following credentials:
Username: admin
Password : admin
Then, the Rundeck dashboard interface will be displayed.
This article covers how to install Rundeck on Ubuntu 20.04 for task automations in the system. In fact, Rundeck is a free open-source software for automation services. With Rundeck, you can create simple to complex tasks on either the local machine or on a remote server.