Skip to content

Deployment Overview of Jenkins on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Ubuntu (specifically for the package installation process).

  • Privileges: Root or sudo access is required to install packages and manage services.

  • Java Environment: OpenJDK 21 JRE and fontconfig are required dependencies.

  • Network Requirements: Access to the internet is necessary to download the Jenkins repository, GPG keys, and Docker images.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template based on the server ID:

Parameter Value
Prefix jenkins-marketplace-app
Domain hostkey.in
Full template jenkins-marketplace-app{Server_ID}.hostkey.in

Application installation process

The installation of Jenkins is performed through a combination of package management and service configuration:

  1. Dependency Installation: The system updates the local package index and installs fontconfig and openjdk-21-jre-headless.

  2. Repository Configuration:

  3. The Jenkins GPG key (jenkins.io-2026.key) is downloaded to /usr/share/keyrings/jenkins-keyring.asc.

  4. The official Jenkins Debian repository is added to the system's software sources.

  5. Jenkins Installation: The jenkins package is installed via the apt package manager.

  6. Environment Configuration:

  7. The system automatically detects the JAVA_HOME path from the installed Java binary.

  8. This path is explicitly configured in /etc/default/jenkins to ensure Jenkins uses OpenJDK 21.

  9. Service Initialization: The Jenkins service is enabled to start on boot and is started immediately after configuration.

Access Rights and Security

  • Firewall/Ports: The application is secured behind a reverse proxy. While the internal service runs on port 8080, external access is routed through standard HTTPS (port 443).

  • Service Management: Jenkins is managed via systemd.

Docker Containers and Their Deployment

The deployment utilizes a Docker container to handle SSL termination and Nginx reverse proxying.

Nginx Certbot Container

  • Image: jonasal/nginx-certbot:latest

  • Network Mode: host

  • Restart Policy: unless-stopped

  • Environment Variables:

  • [email protected]

  • Volumes:

  • nginx_secrets:/etc/letsencrypt (External volume for SSL certificates)

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d (Custom Nginx configurations)

Application Update Instructions

To update the Jenkins application, use the standard package manager commands:

sudo apt update
sudo apt upgrade jenkins

For the proxy layer, if using Docker Compose in /root/nginx:

cd /root/nginx && docker compose pull && docker compose up -d

Location of configuration files and data

  • Jenkins Configuration: /etc/default/jenkins (Java environment settings).

  • Nginx User Configurations: /data/nginx/user_conf.d/

  • Nginx Environment Variables: /data/nginx/nginx-certbot.env

  • SSL Certificates: Managed via the nginx_secrets Docker volume.

Available ports for connection

Service Internal Port External Port Protocol
Jenkins (via Proxy) 8080 443 HTTPS

Starting and Stopping the application

The main Jenkins service is managed using systemctl:

  • Start Jenkins: sudo systemctl start jenkins

  • Stop Jenkins: sudo systemctl stop jenkins

  • Restart Jenkins: sudo systemctl restart jenkins

  • Check Status: sudo systemctl status jenkins

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×