Last reviewed: September 2026
Jenkins is an open-source automation server used to build, test and deliver software. Teams commonly use it for continuous integration and continuous delivery pipelines, scheduled automation, quality checks and controlled deployments.
How Jenkins works
- The controller stores configuration, schedules work, provides the web interface and coordinates pipelines.
- Agents provide executors and workspaces where build steps run.
- Jobs define automation through the web interface or source-controlled pipeline files.
- Plugins add integrations for source control, credentials, build tools, notifications and deployment targets.
- Credentials are stored centrally and exposed to authorized jobs only when required.
For production installations, avoid running resource-intensive builds on the controller. Use dedicated agents with the minimum network access and permissions required by each workload.
Requirements for Ubuntu
Current Jenkins Linux documentation requires Java 21 or later. Install Java before Jenkins so the service can locate a supported runtime when it starts.
- A supported Ubuntu or Debian release
- Java 21 or later
- Administrative access for package and service installation
- Port 8080 available temporarily or a configured reverse proxy
- Persistent storage for JENKINS_HOME
- Reliable backups before upgrades
Install Java 21
sudo apt update
sudo apt install -y fontconfig openjdk-21-jre
java -versionInstall the Jenkins LTS package
Add the official Jenkins Debian LTS repository and its current signing key by following the Jenkins Linux installation reference, then refresh package metadata and install the Jenkins package.
sudo apt update
sudo apt install -y jenkinsStart and verify Jenkins
sudo systemctl enable --now jenkins
sudo systemctl status jenkins
sudo journalctl -u jenkins.service --no-pager -n 100By default, the package listens on port 8080. In production, place Jenkins behind HTTPS, restrict network access and avoid exposing the controller directly to the public internet.
Complete initial setup
- Open the Jenkins URL on port 8080 or through the configured reverse proxy.
- Retrieve the one-time administrator password from the controller.
- Paste the password into the Unlock Jenkins page.
- Install only the plugins required for the planned workloads.
- Create a named administrator account and disable unnecessary anonymous access.
- Configure the public Jenkins URL and verify time, email and proxy settings.
sudo cat /var/lib/jenkins/secrets/initialAdminPasswordCreate a pipeline as code
Store a Jenkinsfile in the application repository so pipeline changes receive code review, version history and the same release controls as application code.
| Stage | Purpose |
|---|---|
| Build | Compile or package the application |
| Test | Run automated verification and publish results |
| Deploy | Release an approved artifact to the target environment |
Manage credentials safely
- Store secrets in Jenkins Credentials instead of source code or pipeline parameters.
- Grant credentials only to folders and jobs that require them.
- Prefer short-lived tokens, workload identity or cloud-native identity when supported.
- Avoid interpolating secrets into shell commands where they can appear in logs or process listings.
- Rotate credentials and review their usage after staff or system changes.
Controller and agent security
- Run builds on dedicated agents rather than the controller.
- Use separate agents or labels for workloads with different trust levels.
- Apply least-privilege operating-system and cloud permissions.
- Keep Jenkins core and plugins on supported versions.
- Review plugin dependencies and remove unused plugins.
- Require authentication and role-based authorization.
- Protect the controller with HTTPS, backups and restricted administrative access.
Backups and upgrades
Back up JENKINS_HOME, including job configuration, credentials, plugin state and system configuration. Test restoration in an isolated environment. Before upgrading, read the LTS upgrade guidance, verify Java compatibility, update plugins carefully and retain a rollback plan.
Common troubleshooting
- Service will not start: verify Java compatibility and inspect systemd logs.
- Port 8080 is occupied: configure another port or correct the conflicting service.
- Agent remains offline: check credentials, transport, labels, Java and network reachability.
- Pipeline cannot find a command: verify the agent image, PATH and tool configuration.
- Plugin errors after upgrade: review dependency requirements and test the upgrade outside production first.
- Builds are slow: inspect queue time, executor capacity, workspace I/O and external dependency latency.
Operational best practices
- Keep pipeline definitions in source control.
- Use reproducible agent images and pinned tool versions.
- Separate build, test, security scan and deployment stages.
- Publish test reports and retain only necessary artifacts.
- Use approvals and protected environments for sensitive deployments.
- Monitor queue length, failed jobs, storage growth and controller health.
- Document recovery procedures and test backups regularly.
Official references
Join the discussion
0 CommentsAsk questions, add context, or share what worked.
More from Melochip Editorial
Learn what Playwright testing is, why modern QA teams use it, how testers can get started, and the major types...
7 min read · Sep 19, 2026
Learn how Kubernetes Deployments and ReplicaSets work with practical YAML, scaling, self-healing, rolling upda...
7 min read · Sep 17, 2026
Learn Kubernetes security best practices with RBAC, Secrets, ServiceAccounts, Pod securityContext, NetworkPoli...
6 min read · Sep 17, 2026Related articles
Learn Kubernetes security best practices with RBAC, Secrets, ServiceAccounts, Pod securityContext, NetworkPoli...
6 min read · Sep 17, 2026
Learn Kubernetes ConfigMaps and Secrets with YAML, environment variables, file mounts, update behavior, immuta...
8 min read · Sep 17, 2026
Learn how Kubernetes Deployments and ReplicaSets work with practical YAML, scaling, self-healing, rolling upda...
7 min read · Sep 17, 2026
Learn Kubernetes monitoring and logs with kubectl logs, events, metrics-server, top commands, Prometheus, Graf...
5 min read · Sep 17, 2026Stay in the loop. Get new Melochip articles
Receive Melochip article updates when new articles are available. Explicit opt-in only.
No comments yet. Start the discussion.