DEV Community

Cover image for Self-hosted LanguageTool private instance is an offline alternative to Grammarly
Gardner Bickford
Gardner Bickford

Posted on

5

Self-hosted LanguageTool private instance is an offline alternative to Grammarly

Setting up LanguageTool is easy. If you have DNS ad blocking enabled then you will want to disable abTesting as described in this post.

docker-compose.yml



services:
languagetool:
image: silviof/docker-languagetool:latest
restart: unless-stopped
command: java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8010 --public --allow-origin '*' --config /etc/http_server.cfg
ports:
- 127.0.0.1:8010:8010
volumes:
- ./ngrams:/ngrams
- ./http_server.cfg:/etc/http_server.cfg

Enter fullscreen mode Exit fullscreen mode




Download ngrams

These weigh about 8.3GB



mkdir ngrams
wget https://languagetool.org/download/ngram-data/ngrams-en-20150817.zip
(cd ngrams && unzip ../ngrams-en-20150817.zip)
rm -f ngrams-en-20150817.zip

Enter fullscreen mode Exit fullscreen mode




Disable AB Testing

To prevent outgoing network requests to fetch said tests:



cat <<EOF > http_server.cfg
languageModel=/ngrams
abTest=null
abTestClients=null
EOF

Enter fullscreen mode Exit fullscreen mode




Start Server




docker compose up -d

Enter fullscreen mode Exit fullscreen mode




Install Browser Extension

Configure Browser Extension

In advanced config set API server to http://127.0.0.1:8010/v2

Image description

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay