Deploy LanguageTool API

Grammar and spell checks over the /v2/check HTTP API

Deploy LanguageTool API

Just deployed

Deploy and Host self hosted LanguageTool API (Self-Hosted Grammar and Spell Check API) on Railway

This template runs the LanguageTool 6.8 HTTP server, so your apps, CMS, or CI jobs can call POST /v2/check for grammar and spell checks without sending text to a SaaS.

About Hosting LanguageTool API open-source software on Railway (self hosted the LanguageTool HTTP API template)

This template runs the official erikvl87/languagetool:6.8 image as one Java service on port 8010, so your text stays on infrastructure you control instead of passing through a SaaS endpoint.

Railway handles the container build, the public HTTPS domain, the health check against GET /v2/languages, and restarts if the JVM fails.

Why Deploy LanguageTool API, the LanguageTool Premium API alternative on Railway (Railway Free Trial)

The Premium API is hosted, with AI rules and account dictionaries on the vendor's terms.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying LanguageTool API on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Railway vs Other Hosting Providers and VPS for LanguageTool API self hosting

Running the LanguageTool server yourself means choosing where the Java process lives.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanA template that builds the LanguageTool 6.8 image on port 8010 with no Droplet to manage.Root on a Droplet, so you install Docker, set up TLS, and size the heap yourself.
AWSHeap and per-IP limit defaults already set, with no VPC to configure.Fine-grained instance and network control, with more setup before your first check.
HetznerThe rate limit and max text length are dashboard variables you can change.Cheap RAM for a large heap, but patching, backups, and restarts are yours.

A VPS suits Docker fleets that want the lowest cost per gigabyte; Railway gets the API reachable fastest.

Common Use Cases for hosted LanguageTool API

  • Grammar checks in a CMS editor: Call POST /v2/check with language=en-US from a save hook or editor plugin and show each match's message and replacements inline. Text stays on your own infrastructure.
  • Docs linting in CI: Send each Markdown file to /v2/check and use disabledRules for noisy rules you accept. Fail the build only when the matches array is not empty.
  • Checking user-generated content before publishing: Route comments and reviews through the API and hold posts with serious matches for moderator review. Raise langtool_requestLimit if your traffic exceeds the default of 120 requests per 60 seconds per client IP.
  • Spell check for an internal app: Call the API from a support tool so agents get suggestions as they type. Use enabledOnly or enabledCategories to keep feedback focused on spelling.
  • Batch checking of translation strings: Loop over translated strings with the target language code and motherTongue set to the source language to catch false friends. Keep each text under 100000 characters.

Dependencies for LanguageTool API Docker hosted on Railway

This section lists what the LanguageTool API template needs from Railway and what it ships with.

Deployment Dependencies for Managed LanguageTool API Service (Grammar Checker)

The template has no external services to connect. A volume is only needed if you later enable n-gram data, which stays off under NGRAM_LANGUAGES=none.

Implementation Details for LanguageTool API (Using LanguageTool official docker image)

The image bundles the Java runtime and rule set, so the template mainly tunes memory and limits. Java_Xms defaults to 256m and Java_Xmx to 1g, which suits light use.

How does LanguageTool API compare against other grammar check APIs

LanguageTool API vs LanguageTool Premium API (LanguageTool Premium Alternative)

  • Where it runs: This template runs the open LanguageTool 6.8 server on your Railway project, so text is checked on your infrastructure.
  • Rule set: Premium adds AI-based rules and account dictionaries under /v2/words, which a self-hosted server does not provide. You control the open rules with enabledRules, disabledRules and enabledCategories.
  • Honest trade-off: Premium has the newest rules and the least setup. Self-hosting means you own the Java heap and the request limit.

LanguageTool vs Grammarly API (Grammarly Alternative)

  • Public API access: LanguageTool exposes a plain HTTP JSON API you can call from any app. Grammarly has no general public API for new developers, and its SDK has been discontinued.
  • Checking output: LanguageTool returns a matches array with offsets, lengths, replacement values and rule IDs, so your code can filter or apply fixes itself.
  • Where Grammarly wins: It has a polished writing experience and a stronger model for tone in English. LanguageTool suits scripted checks better than a consumer writing assistant.

LanguageTool vs Vale (Vale Alternative)

  • Scope: LanguageTool is a grammar and spell checker built on a rule model. Vale is a prose linter that enforces house style rules written in YAML.
  • Use in CI: Vale is strong for style guides across docs repos. LanguageTool catches grammar errors in the same text.
  • Honest note: Vale is quicker to set up for style-only linting and needs no server. Many teams run both.

LanguageTool vs Hunspell (Hunspell Alternative)

  • Coverage: Hunspell is a spelling library with dictionaries and affix rules. It does not check grammar or sentence context.
  • Integration: Hunspell is a local library you link into a program. LanguageTool is a network service you call with a POST to /v2/check.
  • Where Hunspell wins: For spelling alone it is lighter and has no Java heap to size. LanguageTool catches agreement and word-choice errors that Hunspell cannot see.

How to use LanguageTool API (the OSS grammar and style checker)?

  1. Deploy and wait until GET /v2/languages returns HTTP 200, which takes about a minute while models load.
  2. Send a curl check with language=en-US and a typo, then read the matches array.
  3. Call the same endpoint from Python with requests, passing text as form data.
  4. Disable a noisy rule with disabledRules, using the ID from rule.id.
  5. Add a CI step that exits non-zero when matches is not empty.
  6. Raise langtool_requestLimit above the default 120 per 60 seconds if your pipeline sends many checks.
curl -s -d language=en-US --data-urlencode "text=This are a test." https://your-domain/v2/check
import requests

resp = requests.post(
    "https://your-domain/v2/check",
    data={"language": "en-US", "text": "This are a test.", "disabledRules": "WHITESPACE_RULE"},
    timeout=30,
)
resp.raise_for_status()
for m in resp.json()["matches"]:
    print(m["rule"]["id"], m["message"])

How to self host LanguageTool API on other VPS Services (LanguageTool self hosting guide)

Clone the Repository

Clone the template repo onto the VPS and move into it:

git clone https://github.com/onepush-dev/languagetool.git
cd languagetool

Install Dependencies

You need Docker and Docker Compose on the host. Pull it once to confirm the registry is reachable:

docker pull erikvl87/languagetool:6.8

Configure Environment Variables

The image runs with defaults and needs no secrets. Set the variables you care about, such as the heap size and per-IP limits:

export Java_Xmx=2g
export langtool_requestLimit=120
export langtool_requestLimitPeriodInSeconds=60
export langtool_maxTextLength=100000

Keep langtool_trustXForwardForHeader set to false on a bare VPS unless a trusted reverse proxy sets X-Forwarded-For.

Start the LanguageTool API Application

Start the container on port 8010 and check the health endpoint:

docker run -d -p 8010:8010 -e Java_Xmx=2g erikvl87/languagetool:6.8
curl -s https://your-domain/v2/languages | head -c 200

Put a TLS reverse proxy in front of port 8010 so requests to https://your-domain reach the server.

Official Pricing of LanguageTool API (LanguageTool pricing)

LanguageTool itself is free and open source under the LGPL, so running this self-hosted server costs nothing in license fees.

LanguageTool API cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting swaps a monthly cloud fee for a server you run yourself.

Monthly cost of self hosting LanguageTool API on Railway

Expect roughly $5 to $15 per month for one Java service with a 1 GB heap at light use, and more with n-grams or heavy traffic.

System Requirements for Hosting LanguageTool API on a VPS

Plan for at least 1 GB of RAM for the default Java_Xmx=1g setting, and raise the heap to 2g for many languages or concurrent checks.

Frequently Asked Questions (FAQs)

Is this the same API as languagetool.org?

It uses the same /v2/check and /v2/languages endpoints and the same JSON response shape.

Why do I get HTTP 429?

The server limits each client IP to 120 checks per 60 seconds by default.

What is the text size limit?

One check accepts up to 100000 characters by default, set by langtool_maxTextLength. Split longer documents into chunks and check each one separately.

Can I add custom words to the dictionary?

Not through the account dictionary endpoints under /v2/words, since those belong to the Premium cloud.

Does it support auto language detection?

Yes. The response reports the language it detected.

Does it need n-grams?

No. N-grams are optional and improve detection of confusion-based errors such as their and there.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
50
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51