Deploying a LanguageTool App
Introduction
LanguageTool is an open-source grammar, style, and spell checker. Deploying LanguageTool with a Dockerfile on Klutch.sh gives you reproducible builds, managed secrets, and persistent storage for optional dictionaries—all configured from klutch.sh/app. This guide covers installation, repository prep, a production-ready Dockerfile, deployment steps, Nixpacks overrides, sample API usage, and production tips.
Prerequisites
- A Klutch.sh account (create one)
- A GitHub repository containing your LanguageTool configuration (GitHub is the only supported git source)
- Docker familiarity and basic JVM knowledge
- Optional: custom dictionaries or language packs stored on persistent volumes
For platform onboarding, see the Quick Start.
Architecture and ports
- LanguageTool serves HTTP; set the internal container port to
8010. - If you add supporting services (caches, proxies), run them as separate Klutch.sh TCP apps exposed on port
8000. - Persistent storage is optional for custom dictionaries; mount if needed.
Repository layout
languagetool/├── config/ # Optional configs or custom dictionaries├── 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
Test locally using the official image:
docker run --rm -p 8010:8010 --name languagetool silviof/docker-languagetoolOptional start.sh for portability and Nixpacks fallback:
#!/usr/bin/env bashset -euo pipefailexec java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --publicMake it executable with chmod +x start.sh.
Dockerfile for LanguageTool (production-ready)
Place this Dockerfile at the repo root; Klutch.sh auto-detects it (no Docker selection in the UI):
FROM silviof/docker-languagetool:latest
WORKDIR /app
# Copy custom configs or dictionaries if neededCOPY config /app/config
EXPOSE 8010CMD ["--port", "8010", "--public"]Notes:
- Pin the image tag for reproducible builds.
- If you need extra language packs, add them in the image or mount via volume.
Environment variables (Klutch.sh)
Set these in the Klutch.sh app settings (Secrets tab) before deploying:
PORT=8010LT_PUBLIC=trueLT_LANGUAGES=en-US,de-DE(adjust as needed)- Any JVM options like
JAVA_OPTS=-Xms512m -Xmx1024mif required
If you deploy without the Dockerfile and need Nixpacks overrides:
NIXPACKS_BUILD_CMD="echo LanguageTool uses prebuilt image"NIXPACKS_START_CMD=java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --publicNIXPACKS_JDK_VERSION=17
Attach persistent volumes
In Klutch.sh storage settings, add mount paths and sizes (no names required):
/app/config— optional for custom dictionaries or server configs.
Ensure paths are writable inside the container if you update files at runtime.
Deploy LanguageTool 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.
- Connect the GitHub repository; Klutch.sh automatically detects the Dockerfile.
- Choose HTTP traffic for LanguageTool.
- Set the internal port to
8010. - Add the environment variables above (languages, public flag, JVM options, and any
NIXPACKS_*overrides if you temporarily deploy without the Dockerfile). - Attach persistent volumes for
/app/configif you use custom dictionaries/configs, selecting sizes that fit your needs. - Deploy. Your LanguageTool service will be reachable at
https://example-app.klutch.sh; attach a custom domain if desired.
Sample API request
Check grammar via HTTP:
curl -X POST "https://example-app.klutch.sh/v2/check" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "language=en-US&text=This is an exampel with a typo."Health checks and production tips
- Add a reverse proxy health check hitting
/v2/checkwith a lightweight payload. - Enforce HTTPS at the edge; forward HTTP to port 8010 internally.
- Pin image tags and JVM options; test upgrades carefully.
- Monitor memory usage and tune
JAVA_OPTSfor your workload. - If caching dictionaries or configs, ensure volumes have adequate space.
LanguageTool on Klutch.sh combines reproducible Docker builds with managed secrets, optional persistent configs, and flexible HTTP/TCP routing. With the Dockerfile at the repo root and port 8010 configured, you can run a scalable grammar-checking service without extra YAML or workflow overhead.