Apache Sling 14
Overview
Apache Sling is an open source framework from the Apache Software Foundation for building content-centric web applications on top of a Java Content Repository (JCR). It pairs an Apache Felix OSGi runtime with a Jackrabbit Oak content store, so HTTP requests map directly onto repository resources. It powers content management systems, web platforms and RESTful content services.
This guide covers deploying and configuring Apache Sling 14 on Ubuntu 24.04 on Azure from the SecureAnyCloud Azure Marketplace image. The image runs the official Apache Sling Starter 14 distribution as a single Java process on OpenJDK 21. The Apache Sling Feature Model Launcher starts it from the self-contained oak_tar feature archive, which is verified against a sha256 checksum at build time. The image ships a browsable web UI: the Sling welcome page, the Apache Felix Web Console for managing the OSGi runtime, and the Composum content browser for exploring the JCR repository.
What you get:
- Apache Sling Starter 14 (
org.apache.sling.starter, Apache-2.0), launched by the Apache Sling Feature Model Launcher 1.3.6, both sha256-pinned - OpenJDK 21 JRE headless (the Temurin 21 baseline that the upstream project ships on)
- The
apache-sling.servicesystemd unit, which starts on boot and runs as the unprivilegedsling:slingsystem user - The
apache-sling-firstboot.servicesystemd oneshot, which generates a per-VM administrator password, resets the defaultadmin/admin, and confirms the console before it completes - An HTTP connector bound to loopback only (
127.0.0.1:8080), fronted by nginx on:80 - An unauthenticated
/healthzendpoint (served by nginx, HTTP 200) for load balancer and probe checks - The Sling welcome page, the Apache Felix Web Console (
/system/console) and the Composum content browser (/bin/browser.html), a clickable admin UI - The Feature Launcher home and the Jackrabbit Oak content repository on a dedicated 20 GiB Azure data disk mounted at
/var/lib/sling, so repository content survives independently of the OS disk - An Ubuntu 24.04 LTS base with the latest security patches applied at build time and unattended security updates enabled
- The Azure Linux Agent, for cloud integration and SSH key injection
- 24/7 SecureAnyCloud support with a guaranteed 24 hour response SLA
Architecture
Apache Sling listens on 127.0.0.1:8080 only. It is never exposed directly to the network. nginx terminates :80 and reverse proxies to the loopback connector, and the Azure Network Security Group opens only ports 22, 80 and 443. This keeps the OSGi Web Console and the content repository off the public interface and behind a single, auditable nginx front door.
Deploy the image
Launch the Apache Sling 14 on Ubuntu 24.04 LTS by SecureAnyCloud image from the Azure Marketplace on a Standard_B2s (or larger) VM. Open inbound ports 22 (SSH), 80 (HTTP) and 443 (HTTPS) in the Network Security Group. The image provisions the 20 GiB data disk that carries the content repository automatically.
When the VM is running, connect over SSH as azureuser with the SSH key you selected at launch:
ssh azureuser@<public-ip>Confirm the services are running
Apache Sling and nginx start automatically on boot. Confirm both are active:
systemctl is-active apache-sling.service nginx.serviceBoth commands print active. For the full status view, run:
systemctl --no-pager status apache-sling.service nginx.serviceRetrieve the per-VM administrator password
There is no default login. On first boot, the image generates a unique administrator password, resets Sling's built-in admin account to it, and writes the details to a root-only file. Read the file with:
sudo cat /var/lib/sac/secrets/sac-credentials.txtThe file shows the Sling URL, the console URL, the admin user (admin) and the generated SLING_ADMIN_PASSWORD.
Open the Sling welcome page
Open the VM's public address in a browser:
http://<public-ip>/Sling redirects to its welcome page. The page introduces the Starter and links to the content browser, the System Console and the API documentation.
You can also verify the front door from the shell without a browser. The nginx health endpoint returns 200:
curl -s -o /dev/null -w '%{http_code}\n' http://localhost/healthzSign in to the Apache Felix Web Console
You manage the OSGi runtime through the Apache Felix Web Console at /system/console. Sign in with admin and the password from Step 3. The Bundles view lists every OSGi bundle and its state. A healthy Starter reports all bundles active.
You can confirm the same thing from the shell. Replace <SLING_ADMIN_PASSWORD> with the value from Step 3:
curl -s -u "admin:<SLING_ADMIN_PASSWORD>" http://localhost/system/console/bundles.json \
| python3 -c "import sys, json; print(json.load(sys.stdin)['status'])"The response prints a summary such as Bundle information: 234 bundles in total - all 234 bundles active.
Manage OSGi configuration
The Configuration view (/system/console/configMgr) lists every configurable OSGi service and lets you edit its settings at runtime. Use it to tune Sling's HTTP service, authentication, resource resolver and your own components without restarting the framework.
Browse the content repository
Content in Sling lives in a Jackrabbit Oak JCR repository. The bundled Composum browser at /bin/browser.html gives you a tree view of the repository, including apps, conf, content and libs. You can inspect and edit nodes and properties directly.
Sling's Post Servlet also lets you create content over plain HTTP. For example, create a node from the shell. Replace <SLING_ADMIN_PASSWORD> with your password:
curl -s -u "admin:<SLING_ADMIN_PASSWORD>" -F "message=hello from sac" http://localhost/content/sac-demo/Then read it back as JSON:
curl -s -u "admin:<SLING_ADMIN_PASSWORD>" http://localhost/content/sac-demo.jsonWhere the data lives
The content repository and the Feature Launcher runtime live under /var/lib/sling on the dedicated 20 GiB Azure data disk. They persist independently of the OS disk, and you can resize the volume on its own:
df -h /var/lib/slingManaging the service
Apache Sling is a standard systemd service. Restart it and view its recent logs with:
sudo systemctl restart apache-sling.service
sudo journalctl -u apache-sling.service -n 50 --no-pagerStop the service with sudo systemctl stop apache-sling.service and start it again with sudo systemctl start apache-sling.service. Sling's own logs are under /var/lib/sling/launcher/logs/ (for example error.log).
Security notes
- No default credential ships in the image. The image neutralizes the upstream
admin/admindefault at build time, and first boot generates a unique administrator password before nginx exposes port 80. - Loopback binding. Sling listens only on
127.0.0.1:8080. nginx is the single network-facing front door on:80. - Change the administrator password to one you control after your first login, either in the Web Console or with the Sling user management API:
curl -s -u "admin:<SLING_ADMIN_PASSWORD>" \
-F oldPwd="<SLING_ADMIN_PASSWORD>" -F newPwd="<new-password>" -F newPwdConfirm="<new-password>" \
http://localhost/system/userManager/user/admin.changePassword.html- Keep the VM patched. Ubuntu unattended security upgrades are enabled by default.
- Put Sling behind HTTPS, with TLS terminated at nginx or an Azure load balancer, before you serve production traffic.
Troubleshooting
- The welcome page does not load. Confirm that
systemctl is-active apache-sling.service nginx.servicereportsactivefor both, and that the NSG allows inbound port 80. - The console login is rejected. Re-read the password with
sudo cat /var/lib/sac/secrets/sac-credentials.txt. The password is generated per VM and is notadmin. - Sling is slow to answer right after boot. The OSGi framework needs a few seconds to bring all bundles to the active state on first start.
curl http://localhost/system/console/bundles.jsonshows progress.
Support
SecureAnyCloud images include 24/7 support with a guaranteed 24 hour response SLA. Contact sales@secureanycloud.com for assistance.
Deploy on Azure
Launch Apache Sling 14 on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
Apache Sling is a web framework for content-centric applications. Content lives in a Java Content Repository (Apache Jackrabbit Oak), and every piece of content is a resource with a URL. Scripts or Java servlets render it based on simple naming rules, so you can create, read and change content over plain HTTP. The Apache Sling Starter 14 bundles the framework with an embedded repository, the Apache Felix web console, the Composum repository browser and a set of scripting engines, ready to run.
This guide covers launching and using the Apache Sling 14 on Ubuntu 24.04 AMI from SecureAnyCloud on Amazon EC2. It is one version of the SecureAnyCloud BookStack, CMS, Blogs and Wikis listing on AWS Marketplace. You pick it as the software version when you subscribe and launch.
What you get:
- Two security-updated bundles. Sling Starter 14 ships Apache Sling XSS 2.4.8 and the Felix HTTP Jetty bundle 1.1.8 (Jetty 12.0.32). Both have since had security releases, so this image runs Sling XSS 2.4.12 (fixes CVE-2026-73192, CVE-2026-91852, CVE-2026-91928, CVE-2026-91999 and CVE-2026-92001) and Felix HTTP Jetty 1.2.8 with Jetty 12.1.13 (fixes CVE-2026-10051, rated high, plus CVE-2026-6790, CVE-2026-8384 and the Jetty fixes of October 2026). The old bundles are not on the image at all. Everything else is the official Starter 14 release, and every download is checked against a pinned checksum.
- No shared repository and no default password. The image contains no content repository. First boot on your instance creates its own, with Sling listening on localhost only and the web server not yet started. It immediately changes the
adminpassword from the repository default to a password generated on your instance, and checks thatadmin/adminis refused before the web server starts. The image removes the Starter's sample application (Slingshot), which creates two users whose passwords equal their user names. - Every page needs a sign-in. Anonymous visitors see only the login form. Content, user lists, the JSON views of the repository, the web console and Composum all require a signed-in user, and anonymous writes are refused.
- HTTPS from the first boot. nginx serves Sling on port 443 with a certificate generated on your instance's first boot. Port 80 redirects to HTTPS.
- Sling on localhost, with no outbound network access. Sling listens on
127.0.0.1:8080only, behind nginx. It runs all its components from a local repository on the image, so it never needs the network. The service is allowed no outbound connections except to localhost. - Internal endpoints stay internal. nginx does not serve the DavEx and WebDAV servers, the health check pages or the topology connector. Reach them over an SSH tunnel (Step 9).
- A rate-limited login. nginx limits sign-in requests (a POST to any address ending in
/j_security_check) and password changes to 6 a minute from one address, after a burst of 5. It limits requests that carry a user name and password in an HTTP Basic header to 60 a minute, after a burst of 60. It limits every address to 600 requests a minute, after a burst of 200. All limits use the address of the connection, never a header that a client sends. - Hardened defaults. Sling runs as its own unprivileged account in a systemd sandbox that can write only to its repository. The Sling installation belongs to root and is read-only to Sling. nginx and Sling are blocked from the instance metadata service, and the AMI requires IMDSv2. Requests for a host name that the instance does not serve are dropped, and redirects always name the host you configure, never one that a request claims.
- Fully patched Ubuntu 24.04 LTS at build time, with unattended security upgrades switched on.
What is on the image: Apache Sling Starter 14 (with the two updated bundles above), the Apache Sling Feature Launcher 1.3.6, OpenJDK 21 (Ubuntu package), nginx, Ubuntu 24.04 LTS, cloud-init and the AWS Systems Manager agent. The repository is on a separate 30 GiB EBS volume mounted at /var/lib/sling.
Prerequisites
- An AWS account subscribed to the listing, an EC2 key pair and a VPC subnet with a route to the internet (or a private route that you use for management).
- A security group that allows TCP 22 (SSH), TCP 443 (Sling) and TCP 80 (redirects to HTTPS) from the networks that should reach them. Limit 22 to your own networks, and limit 443 to the people who use Sling.
Launch the instance
In the AWS Marketplace listing, choose Continue to Subscribe, then Continue to Configuration. Pick Apache Sling 14 on Ubuntu 24.04 as the software version, select your Region, and choose Launch through EC2.
Choose m5.large, your key pair and a security group as described in the prerequisites. Keep the second volume (the repository) in the launch settings. You can make it larger there.
To launch with the AWS CLI instead, replace the values in angle brackets:
aws ec2 run-instances --region <region> --image-id <ami-id-from-the-listing> \
--instance-type m5.large --key-name <your-key-pair> \
--security-group-ids <your-security-group> --subnet-id <your-subnet> \
--metadata-options HttpTokens=required,HttpEndpoint=enabled \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=apache-sling}]'Connect to your instance
Version SSH user
Apache Sling 14 on Ubuntu 24.04 ubuntu
ssh -i <your-key.pem> ubuntu@<public-ip>Check the services
First boot takes about a minute. It creates the repository, starts every Sling component and sets the admin password. Afterwards, Sling, nginx and the first-boot unit are active:
systemctl is-active apache-sling nginx apache-sling-firstbootactive active activenginx serves ports 80 and 443. Sling (the java process) listens on localhost only. Check the listeners:
sudo ss -tlnp | awk 'NR==1 || /nginx|sshd|java/' | awk '{print $1, $4, $6}' | sed -E 's/,pid=[0-9]+,fd=[0-9]+//g'State Local Peer LISTEN 0.0.0.0:443 users:(("nginx"),("nginx"),("nginx")) LISTEN 0.0.0.0:22 users:(("sshd"),("systemd")) LISTEN 0.0.0.0:80 users:(("nginx"),("nginx"),("nginx")) LISTEN [::ffff:127.0.0.1]:8080 users:(("java")) LISTEN [::]:443 users:(("nginx"),("nginx"),("nginx")) LISTEN [::]:22 users:(("sshd"),("systemd")) LISTEN [::]:80 users:(("nginx"),("nginx"),("nginx"))Check the Java and nginx versions and the repository volume:
java -version 2>&1 | head -1 nginx -v findmnt -no TARGET,FSTYPE,SIZE /var/lib/slingopenjdk version "21.0.12.1" 2026-08-18 nginx version: nginx/1.24.0 (Ubuntu) /var/lib/sling ext4 29.4GGet your sign-in details
The credentials file holds the address that Sling is served as (your instance's public DNS name by default), the web console address, and the admin user name and password generated on this instance. Show the file with:
sudo cat /root/apache-sling-credentials.txtSLING_URL=https://ec2-<public-ip-dashed>.compute-1.amazonaws.com/ SLING_CONSOLE_URL=https://ec2-<public-ip-dashed>.compute-1.amazonaws.com/system/console SLING_ADMIN_USER=admin SLING_ADMIN_PASSWORD=<24 letters and digits>Sign in
Open SLING_URL in your browser. The certificate is self-signed and generated on your instance, so accept the browser warning once, or install your own certificate (Step 11). The browser shows the login form:
Sign in with the user admin and SLING_ADMIN_PASSWORD. You arrive at the Sling Starter page, with links to the content browser, the HTL scripts REPL and the web console:
The Starter page mentions WebDAV on the root URL. On this image, you reach WebDAV through an SSH tunnel instead (Step 9).
The web console and the updated bundles
The Apache Felix web console (SLING_CONSOLE_URL, or System Console on the Starter page) manages the OSGi bundles, configurations and services that make up Sling. The Bundles page shows all bundles active, including the two security updates:
You can run the same check from the command line. apache-sling-curl is a small helper on the image that calls Sling over HTTPS as admin. It reads the password from the credentials file, so the password never appears on a command line:
sudo apache-sling-curl /system/console/bundles.json | python3 -c ' import json, sys d = json.load(sys.stdin) print(d["status"]) for b in d["data"]: if b["symbolicName"] in ("org.apache.sling.xss", "org.apache.felix.http.jetty12", "org.apache.felix.framework"): print(b["symbolicName"], b["version"], b["state"])'Bundle information: 233 bundles in total - all 233 bundles active. org.apache.felix.framework 7.0.5 Active org.apache.felix.http.jetty12 1.2.8 Active org.apache.sling.xss 2.4.12 ActiveThe checksums of everything that the image was built from are listed in /usr/share/doc/apache-sling/RELEASE:
cat /usr/share/doc/apache-sling/RELEASECreate and read content over HTTP
Every resource in Sling has a URL. A POST creates or changes content (the Sling POST servlet), and a GET with the .json extension reads it back (the default GET servlet). Create a node, read it, check that an anonymous request is refused, and then delete the node:
sudo apache-sling-curl /content/hello -o /dev/null -w '%{http_code}\n' -F 'jcr:primaryType=nt:unstructured' -F 'title=Hello from the content API'
sudo apache-sling-curl /content/hello.json; echo
H=$(sudo grep '^SLING_URL=' /root/apache-sling-credentials.txt | sed -E 's#^SLING_URL=https://([^/]+)/$#\1#')
curl -sk --resolve "$H:443:127.0.0.1" -o /dev/null -w 'anonymous: %{http_code}\n' "https://$H/content/hello.json"
sudo apache-sling-curl /content/hello -o /dev/null -w 'delete: %{http_code}\n' -F ':operation=delete'201 {"jcr:primaryType":"nt:unstructured","title":"Hello from the content API"} anonymous: 401 delete: 200From your own computer, use the same requests with curl -u admin against SLING_URL. curl then asks for the password. You can also sign in through the login form and use the session cookie. See the Sling documentation for the POST servlet's operations and the GET servlet's selectors.
Browse the repository with Composum
Composum (SLING_URL + bin/browser.html, or Browse Content on the Starter page) is a browser for the repository. It shows the node tree, properties, access control and a query tool. It also has a package manager (bin/packages.html) and a user manager (bin/users.html).
Users, passwords and the internal endpoints
To change the admin password, run the following command. It writes a new random password to the credentials file, and Sling keeps running:
sudo apache-sling-set-passwordTo choose the password yourself, pipe it in (24 to 64 letters and digits): sudo apache-sling-set-password --stdin. Create further users in Composum's user manager or the web console (Sling > Users), and give them only the access they need.
nginx does not serve the DavEx server (/server, used by repository tools), the WebDAV server (/dav), the health check pages (/system/health) or the topology connector. Reach them with an SSH tunnel from your computer. Then use http://localhost:8080/ locally and sign in as admin:
ssh -i <your-key.pem> -L 8080:127.0.0.1:8080 ubuntu@<public-ip>Security checks
Anonymous requests get 401 everywhere except the login form. The internal endpoints are not served, the repository default admin/admin is refused, and requests for a host name that the instance does not serve are dropped:
H=$(sudo grep '^SLING_URL=' /root/apache-sling-credentials.txt | sed -E 's#^SLING_URL=https://([^/]+)/$#\1#') for p in / /.json /home/users.infinity.json /system/console /bin/browser.html /server/ /dav/ /system/health; do printf '%-26s %s\n' "$p" "$(curl -sk --resolve "$H:443:127.0.0.1" -o /dev/null -w '%{http_code}' "https://$H$p")" done curl -sk --resolve "$H:443:127.0.0.1" -u admin:admin -o /dev/null -w 'admin/admin: %{http_code}\n' "https://$H/system/console/bundles.json" curl -s -o /dev/null -w 'unknown host on 80: %{http_code}\n' -H 'Host: example.com' http://127.0.0.1/ || true/ 401 /.json 401 /home/users.infinity.json 401 /system/console 401 /bin/browser.html 401 /server/ 404 /dav/ 404 /system/health 404 admin/admin: 401 unknown host on 80: 000A browser that requests / without signing in is redirected to the login form instead of getting 401. 000 means that nginx closed the connection without an answer.
Sling has no outbound network access except to localhost. The metadata service is blocked for nginx as well:
systemctl show -p IPAddressDeny -p IPAddressAllow apache-slingIPAddressAllow=::1/128 127.0.0.0/8 IPAddressDeny=0.0.0.0/0 ::/0If your application needs Sling to reach another server (for example a Maven repository to install bundles from, or an external API), allow just that destination with a drop-in, and then restart Sling:
sudo systemctl edit apache-sling
# add:
# [Service]
# IPAddressAllow=<destination-ip>/32
sudo systemctl restart apache-slingYour own DNS name and certificate
Point a DNS record at the instance (an Elastic IP keeps the address stable), then set the name that Sling is served as. This command creates a new self-signed certificate for the name, makes nginx serve it and name it in every redirect, updates the addresses in /root/apache-sling-credentials.txt, and keeps the name across reboots:
sudo apache-sling-set-hostname <your-domain>To use a certificate from your own certificate authority instead, copy it over the generated pair and reload nginx. Running apache-sling-set-hostname again replaces it with a self-signed one:
sudo install -m 0644 <your-domain>.crt /etc/nginx/ssl/apache-sling.crt
sudo install -m 0600 <your-domain>.key /etc/nginx/ssl/apache-sling.key
sudo nginx -t && sudo systemctl reload nginxYour data
The repository (Oak segment store and indexes), the OSGi framework cache and Sling's logs are on the separate volume at /var/lib/sling:
sudo du -sh /var/lib/sling/launcher/repository /var/lib/sling/launcher/framework
sudo ls /var/lib/sling/launcher63M /var/lib/sling/launcher/repository 12M /var/lib/sling/launcher/framework framework install logs repository resourcesSling's own logs are in /var/lib/sling/launcher/logs (error.log, request.log, access.log). nginx logs are in /var/log/nginx.
To back up, stop Sling (sudo systemctl stop apache-sling), snapshot the volume (or copy /var/lib/sling/launcher/repository), and start Sling again. EBS snapshots of the whole volume are the simplest way to keep point-in-time copies. When the repository needs more room, grow the volume in the EC2 console and run sudo resize2fs on its device.
Server components
Component Version Where
Apache Sling Starter 14 (Oak Segment Tar) /opt/sling/repository, /opt/sling/features
Apache Sling XSS 2.4.12 (security update of 2.4.8) OSGi bundle
Apache Felix HTTP Jetty 1.2.8 with Jetty 12.1.13 (security update of 1.1.8 / Jetty 12.0.32) OSGi bundle
Apache Sling Feature Launcher 1.3.6 /opt/sling/feature-launcher
OpenJDK 21 (Ubuntu package) /usr/lib/jvm/java-21-openjdk-amd64
nginx 1.24 (Ubuntu package) /etc/nginx/sites-available/sac-sling
The services are apache-sling (Sling) and nginx. Sling's Java heap is half the instance's memory. The Sling service unit and its sandbox are defined in /etc/systemd/system/apache-sling.service and the drop-ins next to it.
Security recommendations
- Keep port 22 and port 443 open only to the networks that need them.
- Change the admin password if you share the credentials file, and create separate users with only the access they need.
- Put your own DNS name and a certificate from a public authority in front of Sling (Step 11).
- Allow only the outbound destinations that your application needs (Step 10).
- Snapshot the repository volume regularly (Step 12).
- Unattended upgrades install Ubuntu security updates (OpenJDK and nginx included) automatically. You update Sling itself by replacing the Starter release, so watch the Apache Sling security page.
Support and licensing
Apache Sling, the Sling Starter, the Feature Launcher, Apache Felix and Apache Jackrabbit Oak are open source software from the Apache Software Foundation under the Apache License 2.0. The license and notices are in /usr/share/doc/apache-sling/. The third-party libraries in the Starter carry their own permissive licenses. There is no per-user or per-CPU license fee.
This image runs the unmodified Starter 14 release with the two updated bundles described above, without the Slingshot sample, plus SecureAnyCloud's configuration (sign-in required, Composum's HTTP proxy off). The AMI price covers SecureAnyCloud's hardening, first-boot setup and support.
Apache, Apache Sling, Apache Felix and Apache Jackrabbit are trademarks of the Apache Software Foundation. SecureAnyCloud is not affiliated with or endorsed by the Apache Software Foundation.
- Email: sales@secureanycloud.com
- Website: https://secureanycloud.com
- Support: 24/7, with a 24 hour response SLA
Deploy on AWS
Launch Apache Sling 14 on Ubuntu 24.04 on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com