Run Your Own Private Grammarly Clone Using Docker and LanguageTool
Windows
Summary
- Don’t let AI take over your writing and strip it of its uniqueness (and make you pay for the privilege).
- LanguageTool provides powerful grammar and word-usage checking without sending your writing to online AI platforms.
- You can run it privately and 100% offline in Windows using Docker, and it works with Google Docs as well as desktop software.
Writing is hard. Here’s how you can improve your prose without having to pay for online writing assistants or risk handing over your secret soon-to-be-best-selling novel for training AI models.
Why Not Use Online Writing Tools?
I do a fair bit of copywriting, and while some of those fancy online AI writing assistants would probably have been helpful, I’ve avoided using any of them. Why? Because I don’t want to risk my writing taking on that homogenized ‘AI’ tone. Connecting with readers is important, and while it’s going to get harder and harder to differentiate real writers from AI, content created by humans that truly understand a topic and its impact on real people will (hopefully) always shine through.
I’m also wary of AIs being trained on my content—yes, they’ll scrape it anyway once it’s published (hi, bots!), but the principle of the whole thing is enough to turn me away from most writing tools with a commercial purpose.
What is LanguageTool?
But, I still want some of those AI advantages (especially for grammar checking, the bane of my existence). LanguageTool is the answer to this: it’s an AI-based grammar checker that you can host yourself. All of your writing never leaves your own computer when it is checked, so you can’t be snooped on. Hosting it on your own portable device also means you can use it offline so it’s perfect for writing on the go.
How To Set Up LanguageTool in Windows With Docker
Docker is a program that runs other programs in ‘containers’. These are isolated environments that keep a piece of software and all its dependencies separate from the rest of your system. This means you can install entire software stacks with a few commands, and not have to worry about installing each component yourself. Software deployed for use in Docker is bundled in an executable file called an image.
If you’re just looking for Grammarly alternatives that you don’t have to set up yourself, we’ve got you covered, too.
Step 1: Install Docker Desktop
This tutorial will use Docker to run LanguageTool, so the first step is to install Docker by downloading and installing Docker Desktop for Windows.
Docker runs on both Windows 10 and 11 in either WSL or Hyper-V mode. Home versions of Windows only support WSL mode, and setting up and running Docker in WSL Mode is generally the better option anyway, as it supports more containers.
You should also install the Windows Terminal App before continuing.
Step 2: Download and Run the LanguageTool Docker Image
Before you install LanguageTool using Docker, you should download the n-gram data for your language, and unzip it in your user profile directory (for example, mine are in “%USERPROFILELanguageToolngrams%”). n-grams are statistical models that give LanguageTool additional capabilities like being able to detect word misuse based on context (rather than just grammar issues). They’re optional, but worth the extra couple of minutes (and 10GB of disk space, if you have it) to download and set up.
Once you’ve extracted your n-gram data, run the following command in the Windows Terminal App to download and run the LanguageTool Docker image:
docker run --name langtool -p 8010:8010 -d -e langtool_abTest=null -e langtool_abTestClients=null -e langtool_languageModel=/ngrams -v c:UsersusernameLanguageToolngrams:/ngrams:ro erikvl87/languagetool
This command does the following:
- Starts a new container using the docker run command.
- Sets the name (–name) of the running container to “langtool”.
- Maps port (-p) 8010 from the host to the container (so that other programs can talk to LanguageTool).
- Detaches (-d) the container so that it keeps running once you close the Terminal window.
- Sets several environment variables (-e) to disable AB testing (so that LanguageTool runs 100% offline and privately), and enable n-grams.
- Makes the n-grams folder available to the container as a read-only volume (-v). Note that you’ll need to update the path to the extracted n-grams in your own user profile directory.
If you want more explanation about this command, you can try using ChatGPT to help you understand complex terminal commands in Windows and Linux.
Note that this command may take a while to complete as it has to download the Docker image for LanguageTool first. When it’s done, you can open Docker Desktop to see the image is now running in a container.
Step 3: Add LanguageTool Checking to Firefox
Now that you have LanguageTool up and running on your PC, you need to tell applications how to use it. Firefox is a good start, and has a LanguageTool extension ready to go. To install it, start by typing about:addons in the FireFox address bar to open the Add-ons settings, opening the Extensions Tab, and searching for “LanguageTool”.
Then, click on the the official LanguageTool extension in the Firefox Add-ons search results (make sure it’s the official, Firefox-recommended one).
Install the extension by clicking “Add to Firefox”.
Then, confirm the installation and optionally grant LanguageTool permission to run in private windows.
Once it’s successfully installed, you’ll see the LanguageTool welcome screen. Ignore the talk about sending your data to the online LanguageTool service, we’ll be turning that off in a moment.
Click through and dismiss the welcome screen and then return to the Extensions Tab in the Firefox Add-ons screen.
From the LanguageTool options screen, you can tweak various settings, like enabling Picky Mode to make use of the n-gram data you downloaded earlier.
The final step is to tell the LanguageTool plugin to use the locally running version of LanguageTool in Docker. To do this, update the LanguageTool server to point to http://localhost:8010/v2 (you’ll need to do the same in the LanguageTool settings for any other apps you set up to use it, too).
Docker Lets You Run Some Really Cool Open-Source Projects on Windows
And that’s it! You can try it out by opening a Google doc or any other website that lets you enter text, and start typing some grammatically incorrect text. You’ll get tooltips and status indicators whenever LanguageTool spots something that needs fixing. You can also find LanguageTool plugins for the Chrome and Edge web browsers, and a huge number of other desktop programs on the LanguageTool website.
Docker lets you run some really cool open-source projects on Windows, and because everything’s containerized, there’s less risk of something messing with your system. This means you can try out a lot of cutting-edge apps like self-hosted AI image generation with Fooocus and your own private AI chatbots with Alpaca.