How to setup Jenkins CI on EC2 with https access
How to setup Jenkins CI on EC2 (Ubuntu 22.04 LTS) with https access and self-signed certificates.
This task took me three hours ages ago with Ubuntu 16.04 (and probably still painful with 22.04) by reading a lot of web pages and lots of trial and error. To make your life easier this is what you need to do to setup a Jenkins CI instance using your AWS account.
I've tested this process and it took exactly 5 minutes to get to the https login screen of the new jenkins instance. Most of that time is waiting for the scripted installation of components on the AWS instance.
Login to the instance using the ssh command mentioned above. Then run:
wget --no-cache https://raw.githubusercontent.com/davidmoten/jenkins-ec2-https/master/setup.sh && chmod +x setup.sh
Now edit the file setup.sh
and edit the top block of parameters with the values you want to see in the generated certificate for jenkins website.
# I use vi, you might use nano or anything else you're comfortable with
vi setup.sh
Now run setup:
./setup.sh
Now go to https://your_instance in the browser and paste in the last line output by the setup.sh
script into the administration password in the browser. If the browser times out go to the same url again (make sure it's https). That's it!