Twikoo: a comment backend for static sites that runs on serverless platforms or one Docker container
A simple, safe, free comment system for static websites.
At a glance
- What is it?
- Twikoo adds replies, likes, spam checks and an admin panel to a static site, and its 2.0 line can run on Vercel, Netlify, Cloudflare Workers, CloudBase or a self-hosted Docker container. The documentation is Chinese first, and the details of each platform live on an external site.
- Who is it for?
- Use Twikoo if you run a static blog, can read Chinese-language setup guides or follow the English README, and want a free backend on a platform you already have an account with. Look elsewhere if you need every notification channel to reach commenters, because only email does.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.
Star history
- twikoojs/twikoo2,321 ★ · +25
| Repository | 2026-10-08 | 2026-11-26 |
|---|---|---|
| twikoojs/twikoo | 2.3k | 2.3k |
25 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The Docker image is a thin wrapper that runs npm install tkserver
Twikoo 2.0 self-hosting does not copy the repository into an image. The Dockerfile starts from node:26-alpine in a build stage and runs `npm install --omit=dev "tkserver@${TWIKOO_VERSION}"`, so the container contains whatever version of tkserver was published on npm. The TWIKOO_VERSION build argument decides which one, and when it is not passed the image installs latest.
The runtime stage sets NODE_ENV=production and TWIKOO_DATA=/app/data, creates the data directory, exposes port 8080 and starts `/app/node_modules/.bin/tkserver`. The comment at the top of the Dockerfile says the Docker build is ordered after the npm verification step in the publish workflow. A rebuild from source is therefore not what you get when you build the image yourself, because you pull the published package.
docker-compose.yml stores comments in a LokiJS file unless you point it at MongoDB
The compose file is short:
docker compose up -d
docker compose logs -fThe service uses the image imaegoo/twikoo, restarts unless stopped, maps port 8080:8080 and mounts a named volume twikoo-data at /app/data. By default comments are written to a db.json file in that directory, which the compose comments call the LokiJS database. Setting MONGODB_URI, for example mongodb://user:pass@host:27017/twikoo, switches storage to an external MongoDB, and TWIKOO_DATA is then used only for the captcha cache.
TWIKOO_THROTTLE is set to 250, described as the maximum requests per minute from a single IP. TZ is Asia/Shanghai, which sets the time zone for log timestamps and the displayed last-updated time. Change it if your readers are elsewhere. A single db.json file also means one container owns the data, so running two replicas against the same volume is not something the files describe.
Free hosting is the point, but each platform has its own tutorial
The project lists Tencent CloudBase, Vercel, Netlify, Hugging Face, Railway, Cloudflare Workers, AWS Lambda and EdgeOne Makers as free places to host the backend, and a private server also works. Vercel supports one-click deployment. Each platform has an illustrated tutorial on twikoo.js.org, with Quick Start at twikoo.js.org/quick-start.html.
The repository itself contains no platform-by-platform steps beyond the Docker files and a cloudbaserc.json for CloudBase. That leaves the longest part of any deployment, from account setup to wiring the frontend script, on the external site. A reader who prefers English can open README.en.md, which exists in the repository root next to the Chinese README.
Spam defence stops at the services you register yourself
Twikoo can check comments with Akismet or with Tencent Cloud content security, and both need an account that you create yourself. A manual review mode holds comments until approved, and an XSS filter is built in. A per-IP limit caps how many comments one address can post in 10 minutes, with the number configurable.
If you switch on neither of the external checkers nor manual review, the only automatic protections are the XSS filter and the rate limit. The test environment file .env.example also lists an AI anti-spam setting with an OpenAI-compatible endpoint and a default model name of deepseek-chat. That appears under test variables only, so the documents shown do not confirm it as a production feature for blog owners.
Only email reaches commenters, every other channel notifies the blogger
Email alerts go to both visitors and the blog owner. WeChat through Server Chan, QQ through Qmsg, QQ through go-cqhttp, and the channels handled by pushoo (DingTalk, WeCom, Feishu, Telegram, Discord, Bark, PushDeer, WxPusher) are marked blogger-only. Each needs its own registration, and the go-cqhttp route needs a bot and a QQ account you build and configure.
The consequence is plain: a reader replying to a comment hears about answers only by email, so a site with no working SMTP settings gives readers no notification at all. Notification templates can be customised for the email path.
Image uploads depend on a separate image host you have to pick
Pasting an image into the comment box and inserting an image are both supported, and both can be disabled. Uploaded images go to a CDN or host that you choose: CloudBase image hosting, Qubu, S.EE, Lsky Pro, PicList, EasyImage, Chevereto, or S3-compatible storage such as Cloudflare R2 and MinIO. Twikoo does not store the pictures itself.
That adds a second account and a second token to manage before image comments work. The test variables in .env.example name TEST_IMAGE_CDN and TEST_IMAGE_CDN_TOKEN for the same job. Emoji insertion is also optional, and a custom emoji list can be supplied in the OwO data format.
The admin panel hides behind a password and an optional passphrase
The embedded admin panel logs in with a password. From it you view, hide and delete comments and change configuration. The entrance can be hidden so that it appears only after typing a secret phrase into the page. Comments can be imported from Valine, Artalk and Disqus, which matters for anyone moving off one of those. No export path is documented in the README.
For day-to-day use, Ctrl + Enter replies quickly, unsent comment text is saved as a draft so a refresh does not lose it, replies, likes and dislikes are supported, and a QQ number typed into the nickname field fills in the QQ nickname and email.
Node 26, pnpm and one command start a local demo
The repository is a pnpm workspace with engines set to node >=26 and packageManager [email protected]. The development commands in the README are:
pnpm install
pnpm demo
pnpm lint
pnpm typecheck
pnpm test
pnpm buildpnpm demo starts a client watcher, the tkserver backend and a demo page at http://localhost:9820/demo.html. The build writes packages/client/dist/twikoo.all.min.js. Releases are frequent: 2.0.15 on 2026-10-15, 2.0.16 on 2026-10-21 and 2.0.17 on 2026-10-22, with the last push on 2026-10-25. The licence is MIT. The i18n section lists nine languages, and a requirement of Node 26 means older server images cannot run the development setup.
Editorial conclusion
Use Twikoo if you run a static blog, can read Chinese-language setup guides or follow the English README, and want a free backend on a platform you already have an account with. Look elsewhere if you need every notification channel to reach commenters, because only email does. Before you commit, run the Docker image locally with docker compose up -d and confirm your comments survive a container restart through the twikoo-data volume.
Frequently asked questions
Can Twikoo be self-hosted with Docker?
Yes. The repository ships a Dockerfile and a docker-compose.yml that runs the imaegoo/twikoo image on port 8080 and stores data in the twikoo-data volume.
Which platforms can host the Twikoo backend for free?
The project lists Tencent CloudBase, Vercel, Netlify, Hugging Face, Railway, Cloudflare Workers, AWS Lambda and EdgeOne Makers, and a private server is also possible.
Does Twikoo support spam detection?
It supports Akismet and Tencent Cloud content security, both requiring your own registration, plus a manual review mode, XSS protection and a per-IP limit per 10 minutes.
Can I import comments from another system into Twikoo?
Yes. The admin panel can import comments from Valine, Artalk and Disqus.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/twikoojs-twikoo)Star history chart for your README
[](https://hysenlabs.com/projects/twikoojs-twikoo)Was this useful?