DEV Community

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

Posted on

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

Top comments (0)