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
fontconfigare 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:
-
Dependency Installation: The system updates the local package index and installs
fontconfigandopenjdk-21-jre-headless. -
Repository Configuration:
-
The Jenkins GPG key (
jenkins.io-2026.key) is downloaded to/usr/share/keyrings/jenkins-keyring.asc. -
The official Jenkins Debian repository is added to the system's software sources.
-
Jenkins Installation: The
jenkinspackage is installed via theaptpackage manager. -
Environment Configuration:
-
The system automatically detects the
JAVA_HOMEpath from the installed Java binary. -
This path is explicitly configured in
/etc/default/jenkinsto ensure Jenkins uses OpenJDK 21. -
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 (port443). -
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:
-
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:
For the proxy layer, if using Docker Compose in /root/nginx:
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_secretsDocker 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