Deploying a Solr App
Introduction
Apache Solr is a powerful open-source search platform built on Lucene. Deploying Solr with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. This guide focuses on a single-node Solr server reachable over HTTP.
Prerequisites
- A Klutch.sh account (sign up)
- A GitHub repository containing your Solr Dockerfile (GitHub is the only supported git source)
- Optional: initial configsets/cores you plan to load
For onboarding, see the Quick Start.
Architecture and ports
- Solr serves HTTP on internal port
8983. Choose HTTP traffic and set the internal port to8983. - Persistent storage is required for cores/collections and configs.
Repository layout
solr/├── Dockerfile # Must be at repo root for auto-detection└── README.mdKeep secrets out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Build and run locally:
docker build -t solr-local .docker run -p 8983:8983 \ -v $(pwd)/data:/var/solr \ solr-localDockerfile for Solr (production-ready)
Place this at the repo root; Klutch.sh auto-detects Dockerfiles.
FROM solr:latest
ENV SOLR_HOME=/var/solr/data
EXPOSE 8983CMD ["solr-foreground"]Notes:
- Pin to a specific tag (e.g.,
solr:9.4) for stability. - Use
SOLR_HOMEto point to your data directory.
Environment variables (Klutch.sh)
Common settings:
PORT=8983SOLR_HOME=/var/solr/data- Optional: JVM tuning via
SOLR_JAVA_MEM(e.g.,-Xms512m -Xmx1024m)
If deploying without the Dockerfile and relying on Nixpacks:
NIXPACKS_START_CMD=solr-foreground
Attach persistent volumes
Add storage in Klutch.sh (path and size only):
/var/solr— cores/collections and configs.
Ensure the path is writable inside the container.
Deploy Solr on Klutch.sh (Dockerfile workflow)
- Push your repository—with the Dockerfile at the root—to GitHub.
- Open klutch.sh/app, create a project, and add an app.
- Select HTTP traffic and set the internal port to
8983. - Add environment variables (port,
SOLR_HOME, optional JVM memory). - Attach a volume at
/var/solrsized for your indexes and configs. - Deploy. Access Solr at
https://example-app.klutch.sh/solr.
Sample checks
Core listing:
curl "https://example-app.klutch.sh/solr/admin/cores?action=STATUS&wt=json"Ping a core (replace gettingstarted with your core):
curl "https://example-app.klutch.sh/solr/gettingstarted/admin/ping"Health checks and production tips
- Add an HTTP readiness probe to
/solr/admin/info/system. - Keep JVM memory sized for your workload; tune
SOLR_JAVA_MEM. - Pin image versions and test upgrades in staging before production rollout.
- Monitor volume usage on
/var/solr; resize proactively.
Solr on Klutch.sh delivers reproducible Docker builds, managed secrets, and persistent search data—without extra YAML or CI steps. Configure ports, env vars, and storage, then start indexing and querying your content.