How to Install Rundeck on Ubuntu 20.04


Rundeck is a totally free open-source software application for automation services. It provides self-service access to the procedures and tools they require to get their task done. Using Rundeck you can produce automation workflows from existing tools or scripts. It offers a web console, CLI tools, and a Web API to run automation jobs.

In this tutorial, we discover how to set up the Rundeck neighborhood on Ubuntu 20.04.

Pre-essentials

  • A Ubuntu 20.04 circumstances with atleast 2 CPU
  • 4 GB RAM
  • 20 GB hard drive
  • Java 8 or later on
  • A database – MySQL/MariaDB, Oracle or PostgrSQL
  • Log Store for logs that is either the default file system or a S3 suitable item shop
  • Ports 4440 (http) and 4443 (https) opened

Step 1: Install Java on Ubuntu

Rundeck needs Java 8 or Java 11 to work appropriately. If not set up by default set up Java utilizing the following commands.

First, upgrade the cache of the repository

$ sudo apt upgrade

Now to set up Java 11, run the following command:

$ sudo apt set up openjdk-11-jre-headless

You can confirm the variation:

java -variation

Step 2: Install MySQL on Ubuntu

Rundeck supports MySQL, PostgreSQL, Oracle, and MS SQL Server to keep its information. In our case, we are going to utilize MySQL.

To set up MySQL on Ubuntu run the following command:

$ sudo apt set up mysql-server

Then allow the MySQL service on the start-up, type:

$ sudo systemctl allow mysql-server

Now access to the database:

$ mysql -u root -p

Create the Rundeck database and user:

mysql> CREATE DATABASE rundeckdb;
Query OK, 1 row impacted (0.00 sec)

mysql> PRODUCE USER 'rundeck_user'@'localhost' determined BY 'PASSWORD';
Query OK, 0 rows impacted (0.00 sec)

mysql> GRANT ALL BENEFITS ON *.* TO 'rundeck_user'@'localhost' WITH GRANT ALTERNATIVE;
Query OK, 0 rows impacted (0.00 sec)

mysql> FLUSH BENEFITS;
Query OK, 0 rows impacted (0.00 sec)

mysql> exit
bye

Step 3: Install Rundeck on Ubuntu 20.04

Here we are going to set up the Rundeck neighborhood variation. You can either download the deborah bundle file straight from the site by filling the kind or from the main repository.

Here I am going to set up from the main repository which constantly makes sure to have the most recent variation.

To do that, we will initially import the repo finalizing secret.

$ curl -L https://packages.rundeck.com/pagerduty/rundeck/gpgkey | sudo apt-key include -

Then let’s include the sources list file of Rundeck /etc/apt/sources.list.d/rundeck.list

$ sudo vim /etc/apt/sources.list.d/rundeck.list
deborah https://packages.rundeck.com/pagerduty/rundeck/any/ any primary
deb-src https://packages.rundeck.com/pagerduty/rundeck/any/ any primary

Update the cache of the repository

$ sudo apt upgrade

Now, set up Rundeck utilizing apt command, type:

$ sudo apt set up rundeck

We require now to inform Rundeck how to link the database. We will modify its setup file with some updates. Make sure to change the lines that are currently existing with the excellent worths matching your setup

$ sudo vim /etc/rundeck/rundeck-config.residential or commercial properties
grails.serverURL=http://YOUR_SERVER_IP:4440
dataSource.driverClassName = org.mariadb.jdbc.Driver
dataSource.url = jdbc:mysql://localhost/rundeckdb?autoReconnect=real&useSSL=incorrect
dataSource.username = rundeck_user
dataSource.password = PASSWORD

If you have actually set up another database, then some setups need to alter.

Now allow the service at the start-up

$ sudo systemctl allow rundeckd.service 

Then, start Rundeck service:

$ sudo systemctl start rundeckd.service 

You can examine the status

$ sudo systemctl status rundeckd.service 
● rundeckd.service - LSB: rundeck task automation console
     Loaded: packed (/etc/init.d/rundeckd; created)
     Active: active (running) given that Sat 2021-11-06 01:05:34 UTC; twos earlier
       Docs: guy:systemd-sysv-generator(8)
    Process: 229955 ExecStart=/etc/init.d/rundeckd start (code=left, status=0/SUCCESS)
   Main PID: 229976 (java)
      Tasks: 12 (limitation: 2279)
     Memory: 114.7M
     CGroup: /system.slice/rundeckd.service
             └─229976 java -Drundeck.jaaslogin=real -Djava.security.auth.login.config=/etc/rundeck/jaas-loginmodule.conf -Dloginmodule.name=RDpropertyfilelogin -Drdeck.config=/etc/rundeck -Drundeck.server.configDir=/etc/rundeck -D>

Nov 06 01:05:34 li663-64 systemd[1]: Starting LSB: rundeck task automation console...
Nov 06 01:05:34 li663-64 rundeckd[229955]:  * Starting rundeckd
Nov 06 01:05:34 li663-64 rundeckd[229955]:    ...done.
Nov 06 01:05:34 li663-64 systemd[1]: Started LSB: rundeck task automation console.

We need to initially alter the default password of the admin user as the default one is still admin

$ sudo vim /etc/rundeck/realm.residential or commercial properties
admin:NEW_ADMIN_PASSWORD,user,admin,designer,release,develop

At this point, if you wish to examine that whatever is working, you can attempt to gain access to Rundeck with the IP and port 4440 however you will require to open it on the firewall software prior to.

As we will utilize Nginx, we will require to modify some other setups files in other to customize the URL of Rundeck. We will require to suggest the URL that Nginx will utilize to gain access to Rundeck. We will initially modify the /etc/rundeck/framework.residential or commercial properties setup file

$ sudo vim /etc/rundeck/framework.residential or commercial properties
framework.server.url = http://rundeck.domain.com

Then we will re-edit the /etc/rundeck/rundeck-config.residential or commercial properties setup file. It’s the one we utilized to suggest the IP address of the server and the default port today will put the domain.

$ sudo vim /etc/rundeck/rundeck-config.residential or commercial properties
grails.serverURL=http://rundeck.websitefortesting.com

Step 4: SSL Terminated Proxy

Here we will utilize Nginx as a reverse proxy for SSL Termination. This assists Rundeck with SSL/HTTPS assistance.

Nginx is offered in the apt repository, you can just set up utilizing the following command:

$ sudo apt set up nginx

Now you require to copy the certificate of your Rundeck domain.

$ sudo cp rundeck.domain.com.crt /etc/nginx/certs/rundeck.domain.com.crt

You requirement likewise to copy the secret

$ sudo cp rundeck.domain.com.key /etc/nginx/certs/rundeck.domain.com.key

Let’s get rid of the default setup file to prevent any dispute

$ sudo rm /etc/nginx/sites-enabled/default

Now let’s produce the setup file of Rundeck.

$ sudo vim /etc/nginx/sites-available/rundeck.conf
server {
         server_name rundeck.domain.com;
         listen 80 ;
         access_log /var/log/nginx/rundeck.log;
         return 301 https://$host$request_uri;
 }
 server {
         server_name rundeck.domain.com;
         listen 443 ssl http2 ;
         access_log /var/log/nginx/rundeck.log;
         
                     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
         ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
         ssl_prefer_server_ciphers on;
         ssl_certificate /etc/nginx/certs/rundeck.domain.com.crt;
         ssl_certificate_key /etc/nginx/certs/rundeck.domain.com.key;
         add_header Strict-Transport-Security "max-age=31536000";
         
                     area / {
                 proxy_pass http://localhost:4440;
                 proxy_set_header X-Forwarded-Host $host:$server_port;
                 proxy_set_header X-Forwarded-Server $host;
                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         }
 }

Now let’s allow the setup file

$ sudo ln -s /etc/nginx/sites-available/rundeck.conf /etc/nginx/sites-enabled/rundeck.conf

Check the Nginx setup

$ sudo nginx -t
nginx: the setup file /etc/nginx/nginx.conf syntax is ok
nginx: setup file /etc/nginx/nginx.conf test succeeds

Step 5: Access Rundeck Interface

Now you can go to your web browser and gain access to Rundeck with the URL http://rundeck.domain.com

For Rundeck web user interface gain access to, the username is admin and the password is the one we modified formerly NEW_ADMIN_PASSWORD.

Rundeck login screen

Now you have access to your Rundeck

Rundeck dashboard

You can produce a brand-new job to begin with your setup.

Conclusion

In this tutorial, we discovered how to set up Rundeck neighborhood edition on your Ubuntu 20.04 server. You can make some setups and produce a brand-new job in order to begin utilizing your Rundeck

Synesy.org