1080*80 ad

Installing Rundeck on Ubuntu 22.04

How to Install and Configure Rundeck on Ubuntu 22.04: A Step-by-Step Guide

In the world of IT operations and DevOps, automation is key to efficiency and reliability. Rundeck is a powerful open-source runbook automation platform that allows you to centralize and delegate operational tasks. Whether you’re running ad-hoc commands, deploying applications, or managing incident response, Rundeck provides a secure, auditable, and user-friendly web interface for your scripts and tools.

This guide will walk you through the complete process of installing and configuring Rundeck on a fresh Ubuntu 22.04 server.

Prerequisites

Before we begin, ensure you have the following:

  • An Ubuntu 22.04 server.
  • A non-root user with sudo privileges.
  • A basic firewall configured (we’ll adjust it for Rundeck later).

Step 1: Install Java

Rundeck is a Java-based application, so installing a Java Development Kit (JDK) is our first critical step. We will use OpenJDK 11, which is a stable and recommended version.

First, update your server’s package index:

sudo apt update

Next, install the OpenJDK 11 package:

sudo apt install openjdk-11-jdk -y

Once the installation is complete, you can verify that Java is correctly installed by checking its version.

java -version

You should see output confirming the OpenJDK version 11 installation.

Step 2: Add the Rundeck Repository

Rundeck is not included in the default Ubuntu repositories. To install it, we need to add its official repository to our system. This ensures we receive the correct package and future updates.

First, import the Rundeck GPG key to ensure the packages we download are authentic:

curl -s https://packages.rundeck.com/pagerduty/rundeck/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/rundeck.gpg >/dev/null

Next, add the Rundeck repository to your system’s sources list:

echo "deb [signed-by=/usr/share/keyrings/rundeck.gpg] https://packages.rundeck.com/pagerduty/rundeck/any/ any main" | sudo tee /etc/apt/sources.list.d/rundeck.list

Step 3: Install Rundeck

With the repository configured, we can now install the Rundeck package. First, update the package list again to include the new Rundeck repository:

sudo apt update

Now, install Rundeck using the apt package manager:

sudo apt install rundeck -y

The installer will set up the Rundeck service, create necessary users, and lay down the default configuration files.

Step 4: Configure the Rundeck Server URL

This is one of the most important configuration steps. By default, Rundeck is configured to be accessible only from the local machine (localhost). To access it over the network, you must specify its public URL.

Open the main configuration file with a text editor like nano:

sudo nano /etc/rundeck/rundeck-config.properties

Find the line that starts with grails.serverURL. It will be commented out and set to http://localhost:4440.

You need to uncomment this line and replace localhost with your server’s public IP address or domain name.

# change this to your server's public ip or FQDN
grails.serverURL = http://your_server_ip:4440

Save the file and exit the editor (press CTRL+X, then Y, then ENTER in nano). Failure to set this URL correctly is a common cause of post-installation issues.

Step 5: Start and Enable the Rundeck Service

Now that Rundeck is installed and configured, we can start the service. The service is managed by systemd.

To start the Rundeck service, run:

sudo systemctl start rundeckd

Rundeck can take a minute or two to fully initialize on the first start.

To ensure Rundeck starts automatically whenever the server reboots, enable the service:

sudo systemctl enable rundeckd

You can check the status of the service to make sure it’s running without errors:

sudo systemctl status rundeckd

Look for an active (running) status in the output.

Step 6: Accessing the Rundeck Web UI

With the service running, you can now access the Rundeck web interface. But first, you may need to open the default port in your firewall. Rundeck listens on port 4440 by default.

If you are using UFW (Uncomplicated Firewall), run the following command to allow access:

sudo ufw allow 4440

Now, open your web browser and navigate to the URL you configured in Step 4:

http://your_server_ip:4440

You will be greeted by the Rundeck login screen. The default credentials are:

  • Username: admin
  • Password: admin

Log in with these credentials to access the main dashboard.

Crucial First Steps: Security Best Practices

Your Rundeck installation is now functional, but it’s not yet secure for production use.

  1. Change the Default Admin Password: Your absolute first action should be to change the default admin password. Click the user icon in the top right corner, select “Profile,” and update your password immediately. Using default credentials is a major security risk.

  2. Consider a Reverse Proxy: For any production environment, running Rundeck on plain HTTP is not recommended. You should set up a reverse proxy like Nginx or Apache to handle SSL/TLS termination. This will allow you to access your Rundeck instance via HTTPS, encrypting all traffic between your users and the server.

Conclusion

You have successfully installed and configured Rundeck on your Ubuntu 22.04 server. You now have a powerful automation platform at your fingertips, ready to streamline your operational tasks. From here, you can start creating projects, adding nodes (the servers you want to manage), and writing jobs to automate your workflows.

Source: https://kifarunix.com/install-rundeck-on-ubuntu/

900*80 ad

      1080*80 ad