Automation

Install Jenkins on FreeBSD 15 with Nginx and Let’s Encrypt

A fresh jenkins-lts package on FreeBSD 15 listens on every interface on port 8080 the moment you start it. The setup wizard behind that port hands full control to whoever pastes the initial password first. The OpenJDK 25 build the package pulls from the quarterly branch today is also one of the builds the November Java4Shell advisory lists as affected. Neither problem shows up in service jenkins status, so we deal with both before the wizard runs.

Original content from computingforgeeks.com - post 166457

This guide is how we install Jenkins on FreeBSD 15 now. It covers the package and the Java runtime it really needs, a localhost-only listener, nginx with a Let’s Encrypt certificate, PF, and the four errors we hit on the way. We also timed the first start and recorded memory use. All of it was tested in December 2026 on FreeBSD 15.1 with Jenkins LTS 2.580.2 bound to localhost behind nginx and PF, so no step leaves port 8080 reachable from outside.

What the jenkins-lts package installs

The jenkins-lts package installs the Jenkins WAR, an rc.d script and a jenkins service user, and pulls OpenJDK 25 in as a hard dependency. You do not install Java separately any more. The older advice to run pkg install openjdk21 first and point Jenkins at it now gets in the way, as the troubleshooting section shows. Before you start, check that the box meets these conditions:

  • The host runs FreeBSD 15 on amd64 and you have a user with sudo or a root shell.
  • The machine has at least 2 vCPUs and 4 GB of RAM. Our lab VM had exactly that, and it is the floor, not a target.
  • A DNS A record for the Jenkins hostname points at the server, and TCP port 80 is reachable for the HTTP-01 challenge. Any DNS provider works.
  • Nothing else on the host already uses ports 80, 443 or 8080.

A production controller needs more than this floor, because its size depends on the load you put on it. Check these drivers before you pick a VM size:

  • The plugin count is known, since each plugin adds heap.
  • Build history retention is set, since every kept build lives in JENKINS_HOME.
  • Builds run on agents and not on the controller.

Plan on 4 vCPUs and 8 GB for a team controller that sends its work to agents. If you still need a FreeBSD host, our guide to installing FreeBSD 15 on KVM or Proxmox builds one with ZFS. Then install the package.

sudo pkg install -y jenkins-lts

pkg resolved 42 packages on our clean 15.1 image. Most of them are X11 and font libraries the full OpenJDK 25 package depends on, even on a headless server.

Number of packages to be installed: 42

The process will require 834 MiB more space.
302 MiB to be downloaded.

Confirm which JDK the package chose and that it runs. The dependency list is the part to read: if it names a JDK other than openjdk25 on your mirror, keep that in mind for the jenkins_java_home section further down.

pkg query '%n %v %dn' jenkins-lts
/usr/local/openjdk25/bin/java -version

The terminal below shows both checks on the lab VM, with openjdk25 as the only runtime dependency:

pkg install jenkins-lts on FreeBSD 15 pulling 42 packages with openjdk25 as the runtime dependency

The package puts files in different places from a Linux install. That matters when you back up the controller or follow a Linux guide such as our Jenkins on Ubuntu 26.04 walkthrough:

ItemFreeBSD 15 (jenkins-lts)Debian and Ubuntu package
JENKINS_HOME/usr/local/jenkins/var/lib/jenkins
WAR file/usr/local/share/jenkins/jenkins.war/usr/share/java/jenkins.war
Log file/var/log/jenkins.log (mode 640)systemd journal
Service settings/etc/rc.conf through sysrcsystemctl edit jenkins
Default JDK/usr/local/openjdk25whatever java is on PATH

Back up /usr/local/jenkins as a whole. It holds the jobs, the credentials store and the secrets/ directory that decrypts them, and a restore without secrets/ leaves every stored credential unreadable.

The Java runtime Jenkins actually needs

Jenkins LTS runs on Java 21 or Java 25 and nothing else. The Jenkins Java support policy names 2.541.3 as the last LTS that ran on Java 17. A current controller on an older JDK doesn’t start at all. The rc.d script defaults jenkins_java_home to /usr/local/openjdk25, so the right move on a fresh host is to set nothing. Read the default straight from the script.

grep -E 'jenkins_(home|args|java_home)=' /usr/local/etc/rc.d/jenkins

These three defaults are what the service uses when /etc/rc.conf says nothing:

: ${jenkins_home="/usr/local/jenkins"}
: ${jenkins_args="--webroot=${jenkins_home}/war"}
: ${jenkins_java_home="/usr/local/openjdk25"}

The openjdk25 package message still says the JDK “may require procfs(5) mounted on /proc”. We left procfs unmounted for the whole test. Jenkins started, installed plugins and served the UI without it, so the fstab line older guides add is optional on this release. Mount it if another Java tool on the host asks for it, not for Jenkins.

The default bind address on port 8080

By default, Jenkins binds to all addresses on port 8080, and the package message says so: “Jenkins defaults listens on http://*:8080”. On a host with a public address, that puts the unlock page on the internet before you have created a single user. Enable the service and start it once to see the default for yourself.

sudo sysrc jenkins_enable=YES
sudo service jenkins start

The first start unpacks the WAR into /usr/local/jenkins/war. Its log is mode 640 and owned by jenkins, so read it with sudo. These were the lines that matter on our run, from the extraction to the ready line 14.3 seconds later:

2026-11-23 07:15:56.570+0000 [id=3]	INFO	winstone.Logger#logInternal: Beginning extraction from war file
2026-11-23 07:15:57.559+0000 [id=3]	INFO	org.eclipse.jetty.server.Server#doStart: jetty-12.1.14; built: 2026-10-02T05:48:05.032Z; git: 15cecbd757a2f6b0fdc6a8944f4c6d0020b17da0; jvm 25.0.5.0.3+1-freebsd-1
2026-11-23 07:16:00.051+0000 [id=3]	INFO	o.e.j.server.AbstractConnector#doStart: Started oejs.ServerConnector@38d15e43{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2026-11-23 07:16:10.865+0000 [id=33]	INFO	hudson.lifecycle.Lifecycle#onReady: Jenkins is fully up and running

The {0.0.0.0:8080} connector is the exposure, and sockstat confirms it from the kernel’s side.

sockstat -4 -6 -l -p 8080

A tcp46 *:8080 line means every IPv4 and IPv6 address on the box accepts connections:

USER    COMMAND     PID FD PROTO LOCAL ADDRESS         FOREIGN ADDRESS
jenkins java       3779  9 tcp46 *:8080                *:*                  

Jenkins writes the unlock password in two places: /usr/local/jenkins/secrets/initialAdminPassword and the log, both mode 640. Copy it now, because you need it at the wizard. Treat it as a root password until the first admin user exists:

sudo cat /usr/local/jenkins/secrets/initialAdminPassword

It prints one 32-character hex string and nothing else. Jenkins deletes the file when the wizard finishes, which we confirmed on the lab VM afterwards. Now close the listener. --httpListenAddress=127.0.0.1 keeps Jenkins on loopback so that only nginx can reach it. The heap flags pin memory use, as the next section explains:

sudo sysrc jenkins_args="--webroot=/usr/local/jenkins/war --httpListenAddress=127.0.0.1"
sudo sysrc jenkins_java_opts="-Xms512m -Xmx1g -Djava.awt.headless=true"
sudo service jenkins restart

Setting jenkins_args replaces the script’s default instead of adding to it. That is why the line repeats --webroot. Check the result with service jenkins status and the same sockstat command. The listener should now read tcp4 127.0.0.1:8080:

service jenkins status and sockstat on FreeBSD 15 showing Jenkins bound to 127.0.0.1:8080 with the final rc.conf lines

If you still see *:8080, the restart did not pick up the new arguments. The usual cause is a typo in the variable name, which sysrc accepts without complaint. Run sysrc -a | grep jenkins and compare the output with the three lines above.

First start time and memory on a small VM

On a 2 vCPU, 4 GB VM, Jenkins reaches “fully up and running” in 12 to 14.5 seconds and holds 430 to 620 MB of resident memory with no jobs. Pinning the heap costs about 160 MB of RSS and saves nothing on start time. We timed three cold restarts per setting, from service jenkins start until the ready line appeared, and read RSS with ps -o rss= 30 seconds later:

ConfigurationReady in (3 runs)RSS 30 s after ready
First start, WAR extraction14.3 s563 MB (read 7 min after start)
Default heap (JVM picks 1/4 of RAM)13.07, 13.05, 13.69 s431 to 442 MB
-Xms512m -Xmx1g, no plugins12.98, 12.17, 12.25 s598 to 607 MB
-Xms512m -Xmx1g, 92 suggested plugins13.89, 14.40, 13.73 s580 to 618 MB

The pinned heap reads higher because -Xms512m commits half a gigabyte up front. We keep the setting anyway. A fixed ceiling makes the controller’s memory predictable, and a JVM sized by ergonomics grows until it reaches a quarter of whatever RAM the host has. Installing the 92 suggested plugins added little to start time. The process that had just run the wizard held 784 MB, so plan headroom above the idle figure.

Java4Shell exposure on the packaged JDK

On November 17, 2026, the OpenJDK vulnerability advisory disclosed CVE-2026-114938 (CVSS 8.1), a HotSpot compiler flaw better known as Java4Shell. The advisory lists 25.0.5.0.3 and earlier as affected, and that is exactly the build FreeBSD 15 installs for Jenkins today. The ports tree took the fixed 25.0.5.1 on November 18 with a merge to the 2026Q4 branch. On November 23, neither the quarterly nor the latest package repository had built it yet:

pkg rquery '%n-%v' openjdk25

The quarterly repository returned the affected build. Switching the lab VM to latest returned openjdk25-25.0.5.0.3+1.f.1_2, a packaging revision of the same JDK:

openjdk25-25.0.5.0.3+1.f.1

Don’t rely on pkg audit here. On the same day it reported 16 problems in 9 packages on this box, nginx, curl and expat among them, but nothing for openjdk25 because VuXML had no entry for the CVE yet. The AWS security bulletin fills in what the advisory leaves out. It places the bug in the Base64 decoding intrinsic and says it needs a CPU with AVX-512 VBMI, which means Intel Ice Lake and later or AMD Zen 4 and later. Our GCP Broadwell host lacked it, but you should not assume your hardware does. The bulletin’s interim fix is the -XX:-UseBASE64Intrinsics JVM flag, which turns that intrinsic off. Add it to the Jenkins options and restart.

sudo sysrc jenkins_java_opts="-Xms512m -Xmx1g -Djava.awt.headless=true -XX:-UseBASE64Intrinsics"
sudo service jenkins restart

A flag in rc.conf proves nothing until the running JVM reports it. jcmd reads the flags straight from the live process:

sudo -u jenkins /usr/local/openjdk25/bin/jcmd $(sudo cat /var/run/jenkins/jenkins.pid) VM.flags | tr ' ' '\n' | grep -i base64

The whole sequence on the lab VM is below. It runs from the default true value to -XX:-UseBASE64Intrinsics on the restarted controller, and the login page answered 200 three seconds after the restart.

Applying the UseBASE64Intrinsics Java4Shell mitigation to Jenkins on FreeBSD 15 and confirming it with jcmd VM.flags

Once pkg rquery shows a 25.0.5.1 build, run sudo pkg upgrade openjdk25, restart Jenkins and drop the flag. Agents need the same treatment as the controller. Our Java4Shell guide for Jenkins controllers and agents covers the agent side and container images.

Nginx as the only public listener

With Jenkins on loopback, nginx becomes the only listener the internet reaches. It holds the certificate and passes the headers Jenkins needs to build correct URLs. We based the vhost on the Jenkins project’s nginx reference. Install nginx and certbot with its nginx plugin. vim goes in too, because base FreeBSD ships only vi.

sudo pkg install -y nginx py312-certbot py312-certbot-nginx vim

Because nginx is the one service exposed to the internet, check it against the vulnerability database right after the install. On November 23 the quarterly package nginx-1.30.6,3 came back flagged for seven CVEs, and pkg upgrade had no newer build on that branch. Run the check yourself, since your mirror may be further along. The dry run shows what an upgrade would change, and -F fetches a fresh vulnerability database first:

sudo pkg upgrade -n
sudo pkg audit -F

On our VM the dry run offered 23 upgrades, none of them nginx, and the audit still ended with nginx in the list:

nginx-1.30.6,3 is vulnerable:
  nginx -- multiple vulnerabilities
16 problem(s) in 9 package(s) found.

The upgrades in that dry run include newer curl and expat builds, but not nginx. If nginx is still listed on your box, read the VuXML entry the output links to and decide whether those CVEs touch the modules this vhost uses. The latest branch carried nginx-1.30.6_18,3 that day. Switching a single package to latest mixes branches, so do it knowingly or wait for the quarterly fix, and repeat sudo pkg audit -F weekly either way.

The stock nginx.conf ships a demo server block on port 80. Replace it with a short file that loads vhosts from conf.d, and make the directories it expects:

sudo mkdir -p /usr/local/etc/nginx/conf.d /var/log/nginx
sudo vim /usr/local/etc/nginx/nginx.conf

Replace the contents with this. server_tokens off stops nginx from announcing its version in error pages:

worker_processes  auto;
events { worker_connections  1024; }
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile      on;
    keepalive_timeout  65;
    server_tokens off;
    include /usr/local/etc/nginx/conf.d/*.conf;
}

Next comes the Jenkins vhost. Certbot adds the TLS lines to it later, so it starts on port 80 only:

sudo vim /usr/local/etc/nginx/conf.d/jenkins.conf

Paste the following and change jenkins.example.com to your hostname. proxy_request_buffering off streams uploads and CLI traffic straight through. The Upgrade and Connection headers keep WebSocket agents working:

upstream jenkins {
    keepalive 32;
    server 127.0.0.1:8080;
}

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      '';
}

server {
    listen 80;
    server_name jenkins.example.com;

    access_log /var/log/nginx/jenkins.access.log;
    error_log  /var/log/nginx/jenkins.error.log;

    ignore_invalid_headers off;

    location / {
        proxy_pass         http://jenkins;
        proxy_redirect     default;
        proxy_http_version 1.1;

        proxy_set_header   Connection        $connection_upgrade;
        proxy_set_header   Upgrade           $http_upgrade;
        proxy_set_header   Host              $http_host;
        proxy_set_header   X-Real-IP         $remote_addr;
        proxy_set_header   X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_max_temp_file_size 0;

        client_max_body_size       10m;
        client_body_buffer_size    128k;

        proxy_connect_timeout      90;
        proxy_send_timeout         90;
        proxy_read_timeout         90;
        proxy_request_buffering    off;
    }
}

Don’t add a trailing slash to proxy_pass http://jenkins. The Jenkins documentation warns that a slash there rewrites request paths and breaks parts of the UI. Test the syntax, enable nginx and start it.

sudo nginx -t
sudo sysrc nginx_enable=YES
sudo service nginx start

Both lines of the syntax check have to report success before the start command runs. The rc.d script repeats the check at start:

nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
nginx_enable:  -> YES
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.

If you already run nginx for other sites, our nginx with Let’s Encrypt on FreeBSD 15 guide covers the shared layout. The Jenkins vhost drops into its conf.d unchanged.

TLS from Let’s Encrypt over HTTP-01

Get the certificate with the HTTP-01 challenge. It works with any DNS provider as long as port 80 reaches the server. Certbot’s nginx plugin proves control of the name, rewrites the vhost for TLS and adds the HTTP-to-HTTPS redirect in one pass. Use a real mailbox for -m, because that address receives expiry warnings:

sudo certbot --nginx -d jenkins.example.com --non-interactive --agree-tos --redirect -m [email protected]

On success, certbot prints where it saved the files and which vhost it changed. FreeBSD keeps them under /usr/local/etc/letsencrypt, not /etc/letsencrypt:

Requesting a certificate for jenkins.example.com

Successfully received certificate.
Certificate is saved at: /usr/local/etc/letsencrypt/live/jenkins.example.com/fullchain.pem
Key is saved at:         /usr/local/etc/letsencrypt/live/jenkins.example.com/privkey.pem
This certificate expires on 2027-02-21.
These files will be updated when the certificate renews.

Deploying certificate
Successfully deployed certificate for jenkins.example.com to /usr/local/etc/nginx/conf.d/jenkins.conf
Congratulations! You have successfully enabled HTTPS on https://jenkins.example.com

Certbot moves the original server block to listen 443 ssl and adds a second port-80 block that only redirects. The certificate lasts 90 days. The FreeBSD package renews it through periodic(8) rather than a cron entry, and that job is off until you enable it. The deploy hook reloads nginx so that it serves the new certificate.

sudo sysrc -f /etc/periodic.conf weekly_certbot_enable="YES" weekly_certbot_deploy_hook="service nginx reload"
sudo certbot renew --dry-run

A dry run that ends like this means the weekly job will renew without help:

Congratulations, all simulated renewals succeeded:
  /usr/local/etc/letsencrypt/live/jenkins.example.com/fullchain.pem (success)

The script periodic(8) runs for this is /usr/local/etc/periodic/weekly/500.certbot-3.12, so you can trigger it by hand if you want proof beyond the dry run.

DNS-01 for hosts without a public port 80

A controller on a private network or behind NAT can’t answer HTTP-01, and a wildcard certificate always needs DNS-01. FreeBSD packages a certbot plugin for most DNS APIs. We ran the HTTP-01 path above. The package names below come from pkg search on the same quarterly branch:

DNS providerFreeBSD packagecertbot flag
Cloudflarepy312-certbot-dns-cloudflare--dns-cloudflare
Amazon Route 53py312-certbot-dns-route53--dns-route53
DigitalOceanpy312-certbot-dns-digitalocean--dns-digitalocean
Google Cloud DNSpy312-certbot-dns-google--dns-google
Linodepy312-certbot-dns-linode--dns-linode
OVHpy312-certbot-dns-ovh--dns-ovh
BIND or any RFC 2136 serverpy312-certbot-dns-rfc2136--dns-rfc2136

Here is the Cloudflare plugin as one example. Substitute your provider’s package and flag if you use a different one. Install it and open a credentials file for an API token limited to DNS edits on that zone:

sudo pkg install -y py312-certbot-dns-cloudflare
sudo vim /usr/local/etc/letsencrypt/cloudflare.ini

The file holds a single line with the token.

dns_cloudflare_api_token = your-token-here

Lock the file down before certbot reads it, then request the certificate and install it into the nginx vhost:

sudo chmod 600 /usr/local/etc/letsencrypt/cloudflare.ini
sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /usr/local/etc/letsencrypt/cloudflare.ini -d jenkins.example.com --non-interactive --agree-tos -m [email protected]
sudo certbot install --nginx --cert-name jenkins.example.com --redirect

If DNS-01 fails with an authentication or permission error, the token scope is the usual cause. It needs Zone DNS Edit on the zone that holds the name, not on another zone.

Firewall rules that hold

Binding Jenkins to loopback closes port 8080. PF also closes everything you didn’t mean to open, including whatever a future package starts listening on. A fresh FreeBSD 15 install has no PF loaded at all: pfctl -s info fails with “/dev/pf: No such file or directory”. Write a default-deny ruleset that admits only SSH, HTTP and HTTPS:

sudo vim /etc/pf.conf

Set ext_if to your interface name from ifconfig -l. Ours was vtnet0.

ext_if = "vtnet0"
tcp_in = "{ 22 80 443 }"

set skip on lo0
block in all
pass out all keep state
pass in on $ext_if proto tcp to port $tcp_in keep state
pass in on $ext_if inet proto icmp icmp-type { echoreq unreach }

Loading a ruleset over SSH can lock you out if the port 22 rule has a typo, so validate it before PF goes live. pfctl -nf needs the pf kernel module, which a fresh install has not loaded. Without it the check fails with “Failed to open netlink” rather than checking anything:

sudo kldload -n pf
sudo pfctl -nf /etc/pf.conf

Both commands print nothing on success. Starting PF flushes the state table, and your current SSH session may stall because it has no state entry yet. Do not skip the safety timer: it turns PF off after three minutes if you lose access. Start the timer and PF in one line, so that a stall cannot stop halfway between them:

sudo sysrc pf_enable=YES
sudo sh -c 'nohup sh -c "sleep 180; pfctl -d" >/dev/null 2>&1 &'; sudo service pf start

Open a new SSH session within the three minutes. If it connects, the port 22 rule works. Check that PF reports itself enabled and that the rules loaded:

sudo pfctl -s info | grep Status
sudo pfctl -s rules

The status line has to read Enabled. The rules should expand to exactly this, with nothing else passing inbound:

block drop in all
pass in on vtnet0 proto tcp from any to any port = ssh flags S/SA keep state
pass in on vtnet0 proto tcp from any to any port = http flags S/SA keep state
pass in on vtnet0 proto tcp from any to any port = https flags S/SA keep state
pass in on vtnet0 inet proto icmp all icmp-type echoreq keep state
pass in on vtnet0 inet proto icmp all icmp-type unreach keep state
pass out all flags S/SA keep state

Now cancel the safety timer with sudo pkill -f "sleep 180" and run the status check again. It must still say Enabled. If it reads Disabled, the timer fired before you killed it, and pfctl -s rules keeps listing the rules even though nothing enforces them. Run sudo pfctl -e in that case. The ruleset filters IPv4 only. On a dual-stack host, add pass in on $ext_if inet6 proto icmp6 so that IPv6 neighbour discovery keeps working. Our PF firewall guide for FreeBSD 15 goes further, into tables, rate limits and NAT. On a cloud VM, the provider’s firewall must also allow 80 and 443. Port 80 stays open for the redirect and for HTTP-01 renewals.

Check all of it from a machine outside the server. HTTPS should answer through nginx, the certificate should come from Let’s Encrypt, and port 8080 should time out:

Verifying Jenkins behind nginx on FreeBSD 15 with a Let's Encrypt certificate and port 8080 unreachable from outside

A curl exit code of 28 is a timeout, the result you want on 8080. A “connection refused” there means a packet reached the host and something answered with a reset. That points to a PF rule that isn’t loaded or a cloud firewall that isn’t filtering.

The setup wizard over HTTPS

Run the wizard only after TLS works, so that the unlock password and the first admin password never cross the network in clear text. Open https://jenkins.example.com, paste the string from initialAdminPassword into the Administrator password field and click Continue:

Unlock Jenkins page served over HTTPS by nginx on FreeBSD 15, asking for the initial administrator password
  1. 1Administrator password
  2. 2Continue

The next screen offers Install suggested plugins or Select plugins to install. We took the suggested set. It pulled 92 plugins in 105 seconds on the lab VM and grew /usr/local/jenkins to 267 MB. Choose the second option if you want a smaller attack surface and know what your pipelines need:

Customize Jenkins step of the setup wizard on FreeBSD 15 with the two plugin choices
  1. 1Install suggested plugins
  2. 2Select plugins to install

Then create the first admin. Use a personal Username rather than admin, which is the first name anyone guesses. Give it a long Password from your password manager, then click Save and Continue. This account replaces the unlock password, and Jenkins removes initialAdminPassword once the wizard completes:

Create First Admin User form in the Jenkins setup wizard on FreeBSD 15
  1. 1Username
  2. 2Password
  3. 3Save and Continue

The Jenkins URL field is filled in from the request. Because nginx passes Host and X-Forwarded-Proto, it already reads https://jenkins.example.com/. If it shows http:// or 127.0.0.1:8080, the proxy headers are missing, and links in emails and build badges will break. Confirm the value and click Save and Finish:

Instance Configuration step with the Jenkins URL field set to the HTTPS address nginx serves
  1. 1Jenkins URL
  2. 2Save and Finish

Click “Start using Jenkins” to reach the dashboard. The footer shows the running version, and the build executor panel shows the two executors the controller starts with:

Jenkins dashboard on FreeBSD 15 after the setup wizard, served through nginx over HTTPS

Those two executors run builds as the jenkins user, on the same host that holds every credential. Set them to 0 under Manage Jenkins, then Nodes, then Built-In Node, once your first agent is connected. The same runtime packages we use in the Go on FreeBSD 15 guide work as build tools on a FreeBSD agent.

Errors we hit and how to fix them

We reproduced each of these on the lab VM on purpose. Three of them leave service jenkins status showing something misleading, and with daemon(8) discarding stderr, the log often stays empty too. For more on how rc.d reports state, see our FreeBSD package and service management guide.

WARNING: /usr/local/openjdk21/bin/java is not readable

This follows the old advice to set jenkins_java_home=/usr/local/openjdk21 on a host where only openjdk25 is installed. The rc.d script checks the path before it starts anything:

jenkins not running? (check /var/run/jenkins/jenkins.pid).
/usr/local/etc/rc.d/jenkins: WARNING: /usr/local/openjdk21/bin/java is not readable.
/usr/local/etc/rc.d/jenkins: WARNING: failed precmd routine for jenkins

The dangerous part is what happens if you change the setting while Jenkins is running. rc.d matches the process by the Java path, so status reports “jenkins is not running.” Meanwhile the old JVM keeps serving on 8080 as an orphan that stop no longer reaches. Remove the override with sudo sysrc -x jenkins_java_home, and from then on stop the service before you change any Java setting.

Running with Java 17 … older than the minimum required version (Java 21)

On a JDK older than 21, service jenkins start prints “Starting jenkins.”, the status check says not running, and /var/log/jenkins.log stays at zero bytes. The reason only shows when you run the WAR by hand as the service user:

Jenkins on FreeBSD 15 refusing to start on OpenJDK 17 with the minimum required version Java 21 error

Point jenkins_java_home back at a supported JDK, or remove the override so the openjdk25 default applies. Use the same manual java -jar ... --version run for any start that fails silently.

java.lang.OutOfMemoryError: Java heap space

A heap set too small, which we tested with -Xmx64m, kills the boot. The service still reports itself as running. Only the log tells the truth.

2026-11-23 07:26:22.618+0000 [id=43]	SEVERE	jenkins.InitReactorRunner$1#onTaskFailed: Failed Finalizing set up
java.lang.OutOfMemoryError: Java heap space
2026-11-23 07:26:22.623+0000 [id=33]	SEVERE	hudson.util.BootFailure#publish: Failed to initialize Jenkins
java.lang.OutOfMemoryError: Java heap space

Every request to /login then returns HTTP 500. Raise -Xmx to at least 512m, though we would not run a controller below the 1g used here, and restart. A health check that only runs service jenkins status misses this failure, so probe the HTTP endpoint instead.

The ACME server believes [email protected] is an invalid email address

Let’s Encrypt refuses to register an account with a reserved example domain, and certbot exits before it requests anything:

Unable to register an account with ACME server. The ACME server believes [email protected] is an invalid email address. Please ensure it is a valid email and attempt registration again.

Pass a mailbox you read. --register-unsafely-without-email also works, but then nobody gets the expiry warning if the weekly renewal ever breaks. If HTTP-01 fails with a timeout or connection error instead, port 80 is not reaching nginx: check PF, the cloud firewall and the A record, in that order.

Post-install audit checklist

Run through this list before you add real jobs or credentials. Each item is a condition you can check from a shell or a second machine:

  1. sockstat -4 -6 -l -p 8080 shows 127.0.0.1:8080 and nothing on *:8080.
  2. A request to port 8080 from outside the host times out.
  3. jcmd ... VM.flags shows -XX:-UseBASE64Intrinsics, or pkg info openjdk25 reports a 25.0.5.1 build or newer.
  4. pfctl -s info reads Status: Enabled, and pfctl -s rules starts with block drop in all and passes only 22, 80 and 443 inbound.
  5. curl -sI http://jenkins.example.com/ returns a 301 to HTTPS.
  6. certbot renew --dry-run succeeds and /etc/periodic.conf sets weekly_certbot_enable="YES".
  7. The Jenkins URL in Manage Jenkins, System starts with https://.
  8. /usr/local/jenkins/secrets/initialAdminPassword no longer exists.
  9. The Built-In Node has 0 executors once an agent is connected.
  10. The backup job copies all of /usr/local/jenkins, including secrets/.

Items 1 to 4 are the ones an attacker tests first, so recheck them after every pkg upgrade. An upgrade that rewrites rc.conf or a JDK that moves path can silently undo them. Our broader Java4Shell inventory guide helps find any other JVMs on the same network that need the same flag or patch.

Keep reading

OpenCode CLI Cheat Sheet: Commands, Sessions and Fixes (PDF) AI OpenCode CLI Cheat Sheet: Commands, Sessions and Fixes (PDF) Best Mini PC for Home Assistant: 4 Picks for HAOS and Proxmox Automation Best Mini PC for Home Assistant: 4 Picks for HAOS and Proxmox Best Tablets for a Home Assistant Dashboard Automation Best Tablets for a Home Assistant Dashboard Ansible for Cisco IOS: Run Commands with ios_command and ios_config Ansible Ansible for Cisco IOS: Run Commands with ios_command and ios_config Build an E-Ink Home Assistant Dashboard: TRMNL, E1001, Inkplate Automation Build an E-Ink Home Assistant Dashboard: TRMNL, E1001, Inkplate Install and Configure Foreman 3.x on Debian 11 Automation Install and Configure Foreman 3.x on Debian 11

Leave a Comment

Press ESC to close