{"id":35032509,"url":"https://github.com/loglux/languagetool-docker","last_synced_at":"2026-04-25T01:38:42.609Z","repository":{"id":326295657,"uuid":"1104957083","full_name":"loglux/languagetool-docker","owner":"loglux","description":"Fully self-contained LanguageTool 6.6 server in Docker — fast, private, and enhanced with fastText language detection.","archived":false,"fork":false,"pushed_at":"2025-11-26T23:52:59.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-29T18:23:25.608Z","etag":null,"topics":["docker","grammar-checker","languagetool","languagetool-api","languagetool-server","self-hosted","spellchecker","spelling"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loglux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-26T23:51:31.000Z","updated_at":"2025-11-27T00:08:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/loglux/languagetool-docker","commit_stats":null,"previous_names":["loglux/languagetool-docker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/loglux/languagetool-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loglux%2Flanguagetool-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loglux%2Flanguagetool-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loglux%2Flanguagetool-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loglux%2Flanguagetool-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loglux","download_url":"https://codeload.github.com/loglux/languagetool-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loglux%2Flanguagetool-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32247507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grammar-checker","languagetool","languagetool-api","languagetool-server","self-hosted","spellchecker","spelling"],"created_at":"2025-12-27T07:18:28.615Z","updated_at":"2026-04-25T01:38:42.603Z","avatar_url":"https://github.com/loglux.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Self-hosted LanguageTool Server (Docker + fastText)\n\nThis repository contains a Dockerised setup for running a self-hosted [LanguageTool](https://languagetool.org/) HTTP server with:\n\n- LanguageTool **6.6**\n- Java 17 (JRE)\n- Optional **fastText-based language detection** (using `lid.176.bin`)\n- A small Bash script to build, (re)run and health-check the container\n\nThe server exposes the standard LanguageTool HTTP API at:\n\n- `http://\u003cYOUR_NAS_IP_OR_HOSTNAME\u003e:9006/v2/check`\n\n\u003e Note: the exact host/IP is not hard-coded anywhere – you choose how to expose it (localhost only, LAN, etc.).\n\n---\n\n## Features\n\n- Self-contained Docker image with:\n  - Java 17 runtime\n  - LanguageTool 6.6\n  - fastText binary built from source\n  - `lid.176.bin` language identification model\n- Configured `server.properties` so LanguageTool uses fastText for language detection\n- HTTP server bound to port **9006**\n- `lt_manage.sh` script to:\n  - build the Docker image\n  - stop/remove any existing container\n  - run a new container with `--restart always`\n  - perform a simple health check using `curl`\n- Ready to be used by other services (e.g. editors, note-taking apps, custom backends)\n\n---\n\n## Supported Languages\n\nLanguageTool supports more than 30 languages and dialects; a full up-to-date list is maintained on the **Supported Languages** page:\n\nhttps://dev.languagetool.org/languages\n\nOn that page you can see, for each language:\n\n- Its language code (e.g. `en-US`, `en-GB`, `ru-RU`, `es`, etc.)  \n- how many language-specific rules are available — which gives a rough indicator of how complete the grammar/style support is  \n\nBecause rule coverage varies wildly between languages (from full grammar/style checking to basic spell-checking), it’s recommended to consult the page above to check support level for a given language.\n\n\n---\n\n## Repository contents\n\n- `Dockerfile`  \n  Builds a LanguageTool 6.6 image with Java 17 and fastText support.\n\n- `lt_manage.sh`  \n  Convenience script to build and (re)deploy the container and verify that the server is responding.\n\n---\n\n## Requirements\n\n- Docker installed and running on the host (NAS / server / PC)\n- `curl` available on the host (for the health check in the script)\n- At least:\n  - ~2 GB of free RAM (the container uses `-Xmx2G` heap by default)\n  - ~1–2 GB of disk space for the image (LanguageTool + Java + fastText model)\n\n---\n\n## Quick start\n\n1. Clone this repository to your server / NAS.\n\n2. Make the manage script executable:\n\n```bash\n   chmod +x lt_manage.sh\n```\n\n3. Run the script:\n    \n```bash\n    ./lt_manage.sh\n```\n    \nThe script will:\n\n- build the Docker image `local/languagetool:latest` from the `Dockerfile`;\n\t\n- stop and remove any existing container named `languagetool`;\n\t\n- run a new container:\n\t\n\t- name: `languagetool`\n\t\t\n\t- port mapping: `9006:9006`\n\t\t\n\t- restart policy: `--restart always`\n\t\t\n- wait a few seconds and perform a health check against:\n\t\n\t- `http://localhost:9006/v2/check?language=en-US\u0026text=test`\n\t\t\n\nOn success, you should see:\n    \n```text\n    [SUCCESS] LanguageTool server is up and responding on port 9006.\n```\n    \n\n---\n\n## Accessing the server\n\n### From the host\n\nOn the machine where Docker is running:\n\n```bash\ncurl \"http://localhost:9006/v2/check?language=en-US\u0026text=This%20is%20a%20test\"\n```\n\nYou should receive a JSON response similar to:\n\n```json\n{\n  \"software\": { \"name\": \"LanguageTool\", \"version\": \"6.6\", ... },\n  \"language\": {\n    \"name\": \"English (US)\",\n    \"code\": \"en-US\",\n    \"detectedLanguage\": {\n      \"name\": \"English (US)\",\n      \"code\": \"en-US\",\n      \"source\": \"fasttext\",\n      ...\n    }\n  },\n  \"matches\": []\n}\n```\n\n### From another machine on the network\n\nReplace `\u003cYOUR_NAS_IP\u003e` with the IP or hostname of the host running the container:\n\n```bash\ncurl \"http://\u003cYOUR_NAS_IP\u003e:9006/v2/check?language=en-US\u0026text=This%20is%20a%20test\"\n```\n\nor using POST (recommended for real use):\n\n```bash\ncurl -X POST \\\n  --data-urlencode \"language=en-US\" \\\n  --data-urlencode \"text=This is a simple test.\" \\\n  \"http://\u003cYOUR_NAS_IP\u003e:9006/v2/check\"\n```\n\n---\n\n## Configuration\n\n### Java heap size\n\nThe `Dockerfile` starts LanguageTool with:\n\n```dockerfile\nCMD [\"java\", \"-Xmx2G\", \"-cp\", \"languagetool-server.jar\", \"org.languagetool.server.HTTPServer\", \"--config\", \"server.properties\", \"--port\", \"9006\", \"--public\", \"--allow-origin\", \"*\"]\n```\n\n- `-Xmx2G` – sets the maximum Java heap to 2 GB.\n    \n- Adjust this value if your host has less or more memory, e.g.:\n    \n    - `-Xmx1G`\n        \n    - `-Xmx4G`\n        \n\nAfter changing the `CMD` line, re-run:\n\n```bash\n./lt_manage.sh\n```\n\nto rebuild and restart the container.\n\n### LanguageTool version\n\nThe `Dockerfile` uses:\n\n```dockerfile\nENV LT_VERSION=6.6\n```\n\nIf you want to pin to a different version (e.g. a newer release or snapshot), change this value to the desired version string and rebuild via `lt_manage.sh`.\n\n\u003e Be sure the download URL `https://languagetool.org/download/LanguageTool-${LT_VERSION}.zip` matches a real release or snapshot.\n\n### Port\n\nBy default the container exposes port `9006` and the script maps it as:\n\n```bash\n-p 9006:9006\n```\n\nIf you want to use a different host port, change `HOST_PORT` in `lt_manage.sh`:\n\n```bash\nHOST_PORT=9006\nCONTAINER_PORT=9006\n```\n\nand adapt the `curl` commands accordingly.\n\n### Network / security\n\nThe server is started with the `--public` flag:\n\n```text\n--public\n```\n\nThis makes the LanguageTool HTTP server accessible from other hosts, which is convenient for LAN setups and external clients.\n\nIf you only want to allow local access:\n\n- you can bind the port to `127.0.0.1` when running the container (instead of `0.0.0.0`);\n    \n- or restrict access using a firewall or reverse proxy.\n    \n\nFor example, to bind only to localhost (if you prefer to run without the script):\n\n```bash\ndocker run -d \\\n  --name languagetool \\\n  -p 127.0.0.1:9006:9006 \\\n  --restart always \\\n  local/languagetool:latest\n```\n\n---\n\n## How fastText is integrated\n\nThe `Dockerfile`:\n\n- clones the official fastText repository;\n    \n- patches `src/args.h` to add the missing `#include \u003ccstdint\u003e` (needed for stricter compilers on Alpine);\n    \n- builds the `fasttext` binary;\n    \n- downloads the `lid.176.bin` language identification model;\n    \n- writes these settings to `server.properties`:\n    \n\n```properties\nfasttextModel=/opt/fasttext-model/lid.176.bin\nfasttextBinary=/opt/fastText/fasttext\n```\n\nLanguageTool will then:\n\n- use fastText for language detection whenever it needs to guess the language;\n    \n- still honour the `language=...` parameter if you pass it explicitly.\n    \n\nIf you always specify `language=...` in your requests, fastText is not strictly required, but it improves automatic detection for mixed or unknown texts.\n\n---\n\n## Updating / rebuilding\n\nWhenever you:\n\n- change the `Dockerfile`, or\n    \n- want to update LanguageTool to a new version, or\n    \n- have modified configuration,\n    \n\nsimply run:\n\n```bash\n./lt_manage.sh\n```\n\nThe script will:\n\n1. rebuild the image,\n    \n2. stop and remove the existing `languagetool` container,\n    \n3. start a new one,\n    \n4. run a health check.\n    \n\n---\n\n## Troubleshooting\n\n### `Error: Missing 'text' or 'data' parameter`\n\nIf you see this in response, the server is **working correctly** – it just means your request did not include any text to check. Make sure you always pass either:\n\n- a `text` parameter, or\n    \n- a `data` parameter\n    \n\nfor example:\n\n```bash\ncurl \"http://\u003cYOUR_NAS_IP\u003e:9006/v2/check?language=en-US\u0026text=This%20is%20a%20test\"\n```\n\n### Connection errors\n\n- `Failed to connect` / `Connection refused`  \n    Check that the container is running:\n    \n    ```bash\n    docker ps -a | grep languagetool\n    ```\n    \n    and inspect logs:\n    \n    ```bash\n    docker logs languagetool | tail -n 50\n    ```\n    \n- `Recv failure: Connection reset by peer`  \n    This usually happens if the server is not yet fully started, or if it rejects external connections without `--public`. The provided Dockerfile and manage script already include `--public` and a health-check loop.\n    \n\n### fastText warnings\n\nIf you see:\n\n```text\nfastText not configured - language detection performance will be degraded\n```\n\nit means `LanguageTool` was started without `fastText` configuration. In this setup, the `Dockerfile` configures fastText automatically, so you should **not** see this warning once the new image is built and container is started via `lt_manage.sh`.\n\n---\n\n## Licence\n\n`LanguageTool` and `fastText` have their own licences.  \nThis repository only provides a Docker-based integration around them. Please refer to the respective upstream projects for licence details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floglux%2Flanguagetool-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floglux%2Flanguagetool-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floglux%2Flanguagetool-docker/lists"}