If you are searching for easy and open source software for automation service then Rundeck might be a best option. It is very useful 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.
Rundeck 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.
In this article, we will learn how to install Rundeck on Ubuntu 20.04.
Update the Ubuntu system
Before performing the installation, update and upgrade the Ubuntu system to its latest index repository.
$ sudo apt update
$ sudo apt upgrade
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
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 below.
$ sudo apt install software-properties-common mariadb-server mariadb-client
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.
Install Rundeck on Ubuntu 20.4
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
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
Update the configuration file
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
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
Enable and start the rundeck service as:
$ sudo systemctl enable rundeckd.service
$ sudo systemctl start rundeckd.service
Allow the port in firewall
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
Access the Rundeck webui
Use the following credentials
Password : admin
Dashboard after login
In this article, we learned how to install Rundeck on Ubuntu 20.04 for task automations. Also we covered how to allow the port in the firewall and access Rundeck webui in the browser.